Embedded programs and interfaces for chat conversations

ABSTRACT

Implementations relate to embedded programs and interfaces for chat conversations. In some implementations, a method includes initiating an embedded application in association with a chat interface displayed by a messaging application that executes at least in part on a first user device. The chat interface displays messages originating from other user devices participating in a chat conversation over a network and associated with chat users. An indication is received over the network that one or more particular devices of the other user devices have connected to an embedded session associated with the embedded application. In response, chat identities associated with particular users of the particular user devices are provided from the messaging application to the embedded application. The particular users are designated as member users of the embedded session, and the embedded application is updated based on data received from particular user devices of the embedded session.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a continuation of U.S. patent applicationSer. No. 16/552,902, filed Aug. 27, 2019 and titled EMBEDDED PROGRAMSAND INTERFACES FOR CHAT CONVERSATIONS, which is a continuation of U.S.patent application Ser. No. 15/624,637, filed Jun. 15, 2017 and titledEMBEDDED PROGRAMS AND INTERFACES FOR CHAT CONVERSATIONS (now U.S. Pat.No. 10,404,636), the entire disclosure of both of which are incorporatedherein by reference.

Further, co-pending U.S. patent application Ser. No. 15/624,638, filedJun. 15, 2017 and titled SUGGESTED ITEMS FOR USE WITH EMBEDDEDAPPLICATIONS IN CHAT CONVERSATIONS (now U.S. Pat. No. 10,348,658), isrelated to the present application, and is incorporated by referenceherein in its entirety.

BACKGROUND

The popularity and convenience of digital mobile devices as well as thewidespread of use of Internet communications have caused communicationsbetween user devices to become ubiquitous. For example, users commonlyuse their devices to send electronic messages to other users as textmessages, chat messages, email, etc. In a chat conversation between userdevices, for example, users post text, images, and other types ofcontent data to a chat interface, and the posted data is displayed inthe chat interfaces displayed on the other user devices participating inthe chat conversation.

The background description provided herein is for the purpose ofgenerally presenting the context of the disclosure. Work of thepresently named inventors, to the extent it is described in thisbackground section, as well as aspects of the description that may nototherwise qualify as prior art at the time of filing, are neitherexpressly nor impliedly admitted as prior art against the presentdisclosure.

SUMMARY

Implementations of this application relate to embedded programs andinterfaces for chat conversations. In some implementations, acomputer-implemented method to provide an embedded application inassociation with a messaging application includes initiating a firstembedded application in association with a first chat interfacedisplayed by a first messaging application that executes at least inpart on a first user device. The first chat interface is configured toreceive first user input from a first user and display messagesoriginating from one or more other user devices participating in a chatconversation over a network. The one or more other user devices areassociated with one or more chat users, each chat user being associatedwith a chat identity. The method includes receiving an indication overthe network indicating that one or more particular user devices of theone or more other user devices have connected to an embedded sessionassociated with the first embedded application. In response to theindication, the method provides one or more chat identities associatedwith one or more particular chat users of the one or more particularuser devices from the first messaging application to the first embeddedapplication. The one or more particular chat users are designated as oneor more member users of the embedded session, and the first embeddedapplication is updated based on data received from at least one of theone or more particular user devices of the embedded session.

Various implementations and examples of the method are described. Forexample, in some implementations, the first embedded applicationreceives the first user input from the first user to an embeddedinterface displayed as part of the first chat interface, and the firstuser input includes selection of an interface element in the embeddedinterface, where the first embedded application is updated in responseto the first user input. In some examples, each of the one or moreparticular user devices of the embedded session execute a respectiveembedded application that provides a respective embedded interfaceassociated with a respective chat interface displayed on the respectiveparticular user device, and the first embedded application is updatedbased on the data received from at least one of the particular userdevices of the embedded session, and the data includes other user inputreceived by at least one of the respective embedded interfaces from atleast one of the one or more member users of the embedded session. Themethod can further include obtaining output data from the first embeddedapplication to be displayed in the first chat interface, and, inresponse to receiving the output data, causing a prompt to be displayedby the first user device, the prompt including a user-selectable controlto consent to display of the output data in the chat interface. Themethod can further include, prior to providing the one or more chatidentities to the first embedded application, anonymizing the one ormore chat identities to create anonymized chat identities, such that theanonymized chat identities are provided to the first embeddedapplication.

In some implementations, the method further includes transmittinginformation to the one or more other user devices participating in thechat conversation, where the information causes display of an interfaceelement by the one or more other user devices, the interface elementreceptive to selective user input at each of the one or more other userdevices, and in response to receiving the selective user input at theinterface element on a particular user device, designating theparticular user device as a member device of the embedded session.

In some examples, the method further includes determining one or morecharacteristics of the one or more particular user devices; andproviding the one or more characteristics to the first embeddedapplication. The one or more characteristics can include a geographiclocation of at least one of the one or more particular user devices, alocal time for at least one of the one or more particular user devices,and/or an available data bandwidth over the network for at least one ofthe particular user devices, where the one or more characteristics areused by the first embedded application to determine output informationto be displayed by the one or more particular user devices, and/or causea modification of transmission of input data to the first user devicefrom one or more other devices over the network. In variousimplementations, the method further includes receiving the indicationfrom a server that manages the embedded session, and receiving updatesto the first embedded application from the server, where the updates arebased on the other user input from the one or more particular chatusers, the other user input provided to the server.

In some implementations, the method further includes outputting anotification to be displayed in respective chat interfaces of the one ormore other user devices, where the notification indicates that the oneor more particular user devices are member devices of the embeddedsession. In some implementations, the method further includes outputtinga notification to the chat conversation in response to one or moreparticular types of events that occur in the embedded session, where theone or more particular types of events include events that occur in thefirst embedded application and include: initiation of playback of amedia item, ceasing of the playback of the media item, a change in theplayback of the media item based on at least one of the first user inputand the other user input, a game event occurring in a game of theembedded session, an update to the game based on at least one of thefirst user input and the other user input, and/or an update to a sharedcontent document based on at least one of the first user input and theother user input. In some implementations, the method further includesoutputting a notification to the chat conversation in response toreceiving server event information indicating that one or more eventshave occurred on a server, and providing the server event information tothe first embedded application to display on the first user device.

In further examples, the method further includes determining asuggestion event in the embedded session based on receiving second userinput received from the first user in the first chat interface, embeddedevent information from the first embedded application, and/or serverevent information from a server coupled to the network, obtaining one ormore suggested response items based on the suggestion event, and causingto be displayed the one or more suggested response items by the firstuser device. For example, the method can receive third user inputindicative of a selected suggested response item from the one or moresuggested response items, and cause output of a chat message associatedwith the selected suggested response item in the first chat interfacedisplayed on the first user device and at the one or more other userdevices participating in the chat conversation. In another example, themethod can receive third user input selecting a selected suggestedresponse item from the one or more suggested response items, and provideone or more commands associated with the selected suggested responseitem.

In various examples, the commands can include at least one first commandprovided to the first embedded application, at least one second commandprovided to the first messaging application, and/or at least one thirdcommand provided to the first user device to cause display of outputinformation from a different application executing on the first userdevice. The output information can include information received from aserver device in communication with the first user device. In furtherexamples, the commands can include a first command to add a first set ofone or more other users to the embedded session in response todetermining that a second content item is the same as a first contentitem being output in an embedded interface of the embedded applicationon the first user device, where the second content item is displayed ona first set of one or more user devices not participating in the chatconversation. The command can include a second command to add a secondset of one or more other users to the embedded session in response todetermining that the second set of one or more other users have inputuser comments associated with a fourth content item that is the same asa third content item being output in the embedded interface on the firstuser device, where the fourth content item is displayed on a second setof one or more user devices not participating in the chat conversation.

The method further includes receiving content data at the messagingapplication over a network from a server application executing at aserver device, and providing the content data to the embeddedapplication to cause output information to be displayed by the embeddedapplication for the embedded session in an embedded interface displayedon the first user device and the one or more particular user devices,The method receives event information over the network indicating asuggestion event occurring at the server application, where thesuggestion event is based on input received by the server application byone or more network users different than the one or more chat users. Themethod obtains one or more suggested response items responsive to thesuggestion event, and causes to be displayed the one or more suggestedresponse items in the first chat interface on the first user device,where suggested response items are selectable by user input to cause amessage to be displayed in the chat interface, and/or a command to besent to one of the embedded application and the messaging application.

In some implementations, the method further includes receiving, prior tothe one or more particular chat users being designated as the one ormore member users of the embedded session, selection input from the oneor more particular chat users selecting one or more associated userroles for the embedded session, where the one or more associated userroles are selected from a plurality of predefined user roles. Inresponse to receiving the selection input, the method enables each ofthe one or more particular chat users to be assigned, in the embeddedsession, a respective associated user role selected by the particularchat user, where each particular chat user is enabled to activate one ormore functions of the embedded application associated with therespective associated user role selected by the particular chat user.The method includes outputting indications of the one or more associateduser roles and the one or more particular chat users by the firstmessaging application to the one or more other user devices to bedisplayed.

In some implementations, a system includes a memory and at least oneprocessor configured to access the memory and configured to performoperations including causing a first user device to join a chatconversation provided, at least in part, by a first messagingapplication that executes at least in part on the first user device,where a first chat interface is configured to receive first user inputfrom the first user and display messages originating from one or moreother chat users of one or more other user devices participating in thechat conversation over a network, and each chat user is associated witha chat identity displayed in the first chat interface. The operationsinclude receiving second user input from the first user to the firstchat interface and, in response to the second user input, initiating afirst embedded application in association with the first chat interface.The first embedded application provides output information in anembedded interface that is displayed by the first user device such thatleast a portion of the first chat interface is visible. The operationsinclude providing the chat identity associated with the first user fromthe first messaging application to the first embedded application, wherethe first user is designated as a member user of an embedded sessionassociated with the first embedded application, and the first embeddedapplication is updated based on third user input received from the firstuser to the embedded interface.

Various implementations and examples of the system are described. Forexample, in some implementations, the one or more other chat usersinclude a bot executing on at least one of the first user device and aserver device connected to the first user device by a network, where,based on fourth user input received from the first user in the firstchat interface, the bot causes a display of content data in the embeddedinterface.

In some implementations, a non-transitory computer readable medium hasstored thereon software instructions that, when executed by a processor,cause the processor to provide an embedded application in associationwith a messaging application by performing operations. The operationsinclude receiving first user input from a first user to a first embeddedinterface displayed in association with a first chat interface by afirst embedded application that executes in association with a firstmessaging application on a first user device. The first user input isreceived by the first embedded application, the first chat interface isdisplayed by the first messaging application executing at least in parton the first user device, and the first chat interface is configured toreceive second user input from the first user and display messagesreceived from one or more other user devices participating in a chatconversation over a network. Each of the one or more other user devicesis associated with a respective chat user, each chat user associatedwith a chat identity displayed in the first chat interface. Theoperations include receiving other user input from one or more memberusers of one or more member devices of the one or more other userdevices, where the one or more member devices are included in anembedded session associated with the first embedded application. Theoperations include updating one or more states of the embeddedapplication based on the first user input and based on the other userinput, where the updating includes assigning a respective user status toeach of the one or more member users. The operations include providinginformation indicating the respective user status of the one or moremember users to the first messaging application to be displayed by theother user devices participating in the chat conversation.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of example systems and a network environmentwhich may be used for one or more implementations described herein;

FIG. 2 is a flow diagram illustrating an example method to provide aprogram embedded in a chat conversation, according to someimplementations;

FIG. 3 is a flow diagram illustrating an example method to enable a userto join an embedded session, according to some implementations;

FIG. 4 is a flow diagram illustrating an example method in which a firstdevice processes an event in which a second device has joined anembedded session, according to some implementations;

FIG. 5 is a flow diagram illustrating an example method to provideoutput of a media item using an embedded application in association witha messaging application, according to some implementations;

FIG. 6 is a flow diagram illustrating another example method to provideoutput of an embedded application in association with a messagingapplication, according to some implementations;

FIG. 7 is a flow diagram illustrating an example method to providesuggested response items in association with an embedded application ina chat conversation, according to some implementations;

FIGS. 8A-8E are graphic representations of example user interfacesdisplayed by user devices, according to some implementations;

FIGS. 9A-9C are graphic representations of additional example userinterfaces displayed by user devices, according to some implementations;

FIGS. 10A-10D are graphic representations of additional example userinterfaces displayed by user devices, according to some implementations;

FIG. 11 is a diagrammatic illustration of an example sequence includinginitiation of an embedded application and a user joining an embeddedsession; and

FIG. 12 is a block diagram of an example device which may be used forone or more implementations described herein.

DETAILED DESCRIPTION

One or more implementations described herein relate to embedded programsand interfaces for chat conversations. In various implementations, afirst embedded application can be initiated by user input in a firstchat interface provided by a first messaging application and displayedon a first user device. The first chat interface is configured toreceive user input from a first user and display messages received fromone or more other user devices participating in a chat conversation overa network and associated with a respective chat user. The other userdevices can connect to an embedded session that is associated with theembedded application, where users of the other devices are designated asmember users.

For example, in some implementations, a notification can be provided onother chat devices in the chat conversation, indicating that theembedded session is active. Chat users of the other chat devices canprovide input to their user devices (e.g., select a join controldisplayed in the chat interfaces of their devices) to cause theirdevices to join the embedded session and become member device. Chatidentities of the chat users can be provided to the embedded applicationand use in the embedded application.

The first embedded application can cause an embedded interface to bedisplayed by the user device in association with the chat interface,e.g., as part of the chat interface, within or adjacent to the chatinterface, etc. The embedded interface can receive user input from theassociated user of the user device, e.g., via selection of displayedinterface elements, a keyboard, other input device, etc., and the inputis provided to the first embedded application. The first embeddedapplication can also communicate with the first messaging applicationand the chat interface, e.g., receiving data from chat messages andoutput chat messages displayed in the chat interface and/or in the chatconversation. The first embedded application can communicate with theother member devices that have joined the embedded session, e.g., viathe first messaging application, where the other devices can beassociated with respective embedded applications and messagingapplications. The first embedded application can communicate with thefirst messaging application and one or more servers that communicatewith the first messaging application. Indications of events occurring inthe embedded application or at other connected devices (e.g., server)can be displayed in the chat interface (e.g., in the chat conversationsuch that they are visible by chat users) and/or displayed in theembedded interface.

Embedded applications of various types can be used, e.g., embedded mediaplayer applications to play media items (videos, images, audio segments,etc.), embedded game applications to output game data, embeddedapplications to output content documents (e.g., item lists,spreadsheets, etc.), embedded applications to create and outputreservations or travel itineraries, etc. In some implementations,embedded applications can be downloaded and executed on the first userdevice when initiation of the embedded application is selected in thechat interface. In some implementations, embedded applications can bestandard, standalone applications that can be configured, or theiroutput processed, to provide displayed output in an embedded manner,e.g., display output in an embedded interface in association with a chatinterface of a messaging application.

Various other features are described. For example, in someimplementations, suggested response items can be generated or obtainedby the messaging application or embedded application and displayed inthe chat interface or embedded interface. Some suggested response items,when selected by user input, can provide one or more suggested commandsto the embedded application, messaging application, or first userdevice. Some suggested response items, when selected by user input, canprovide one or more suggested messages to the chat interface, e.g., tothe chat conversation. Suggested response items can be determined basedon suggestion events occurring in the embedded application, messagingapplication, and/or other connected devices, thus providing relevantsuggested input options for a user.

In various implementations, features can include member users beingassigned respective user statuses (e.g., user roles) in the embeddedsession, e.g., a controlling user of media item playback, a player roleor observer role in a game, etc. In some examples, an embeddedapplication can receive user comments in the embedded interface during afirst playback of a media item, and can display those user comments inthe embedded interface during a later, second playback of that mediaitem for chat users that participated in the chat conversation at thetime of the first playback. Displayed output data of embeddedapplications can be synchronized among the member devices of aparticular embedded session. For example, a playback position adjustedby user input on one member device causes the other member devices toadjust the playback positions in the associated embedded interfaces.Bots can be provided in the chat interface and can interface withembedded applications, e.g., initiate embedded applications to processcontent items selected by user input, etc.

One or more features described herein enable users to interact withembedded applications in the context of a chat conversation in whichmultiple user devices participate. Furthermore, multiple chat users caninteract in an embedded application. Features allow chat users to sharefunctions and output of applications in a chat conversation without thechat users having to exit from the chat interface to display aninterface of a separate application. Thus, chat messages can be inputand displayed in the chat interface concurrently with the display ofoutput from an embedded application, allowing chat users to feelconnected in concurrent use of the application. Such features allowgroup, shared, expressive experiences among chat users in an embeddedsession using embedded applications. In some examples, in an embeddedsession playing a media item such as video, features enable chat usersto watch videos together and comment on the video in the chatconversation. If a first chat user is currently watching a video, asecond chat user in that conversation has the option to watch the videowith the first chat user, similarly to sitting on the couch watchingtelevision together in an analogous physical environment. In this sharedexperience, both users can control the playback, control a playlist ofmedia items to watch, chat about features and events in the video,and/or post likes into the video feed.

Communication between an embedded application and a chat interfaceallows compelling and efficient integration of chat and applicationfunctions. For example, an embedded application can send events ornotifications to a message application, and the message application candisplay the events or notifications in the chat conversation and chatinterfaces of the chat users, thus being visible to chat users who arenot currently participating in an embedded session. This can improve theengagement, retention, and awareness of users about the occurrence ofand events within embedded sessions. Similarly, chat messages input tothe chat interface and chat conversation can be input to an embeddedapplication, allowing the embedded application to respond to commandsand messages from the chat interface and chat conversation.

Use of such embedded applications in association with a chat interfaceallows chat users to interact with each other and an embeddedapplication with reduced user input and reduced time to interact whenusing a chat interface and an application, thus reducing consumption ofdevice resources that would otherwise be needed to process, display, andreceive user input in applications that are separate from a messagingapplication. For example, disclosed features reduce consumption ofdevice resources needed to enable and process communications betweenmultiple users simultaneously using chat interfaces and applicationfunctions (e.g., reducing switching displays of different interfaces fordifferent applications on a user device, reducing copying and pastingdisplayed data in one application to another application or interface,reducing the repeating of commands or data input to applications, etc.).Furthermore, embedded applications can be downloaded and installed on auser device seamlessly based on selections within a chat interface,reducing system resources needed to present additional download andinstallation interfaces. In addition, embedded applications can be ofsmall data size, e.g., can use one or more functions of the associatedmessaging application such as communication and network functions, chatinterface functions, etc., and so can omit such functions themselves.This allows specific application functions (e.g., playing media items,providing a game or shared list, etc.) to be implemented in a smallerapplication that consumes fewer bandwidth and storage resources thanindependently-executed applications that each include a complete set offunctions. In some implementations, a standard API can be used betweenmessaging application and embedded application, allowing a large varietyof embedded applications to be provided by many different providers.

Consequently, a technical effect of one or more describedimplementations is that chat communication between user devices indevice-implemented conversations is provided in conjunction withdisplayed and interactive features from applications with lesscomputational time and resources expended to obtain results. Forexample, a technical effect of described techniques and features is areduction in the consumption of system processing resources utilized toprovide chat communication and application functions as compared to asystem that does not provide one or more of the described techniques orfeatures, e.g., a system that uses prior techniques of displayingapplication output in separate applications unassociated with chatinterface communication in which additional computational resources areneeded to run the separate application and cause a user to switchbetween application and chat conversations, provide additional input toapplications, etc. In another example, a technical effect of describedtechniques and features is a reduction in the consumption of systemprocessing resources utilized by a system that does not provide one ormore of the described techniques or features, e.g., a system that usesonly bots in chat interfaces to provide application functions andinterface with chat users, since such bots may present output in a chatinterface that is confusing to multiple chat users participating andproviding messages in a chat conversation, leading to inefficient use ofsystem resources (e.g., repeated viewing, scrolling, and input ofcommands from users to display previously-output messages and outputprovided by the bot, etc.). Thus, a technical effect of describedtechniques and features is a reduction in the consumption of systemprocessing resources utilized to receive input from multiple users ascompared to a system that does not provide one or more of the describedtechniques or features.

In some implementations, suggested response items may be automaticallyprovided in response to suggestion events occurring in embeddedapplications, messaging applications, or other devices. The suggestedresponse items are appropriate and relevant as commands or messages tothe suggestion event. For example, suggested message items may causeappropriate messages to be displayed in the chat conversation asreactions to particular events occurring in an embedded application orother program (e.g., events based on user input from other users, orevents in played content data), as if a user were creating the messages.Suggested command items may cause suggested relevant commands to be sentto the embedded application or other application/device in response toevents in an embedded application or other program, e.g., a command tochange media playback in response to a detection of features in theplayed media item, a command to perform a game action in response to anopponent's detected action in a game, etc. These suggested items provideusers with more flexible options in determining their responses toevents in applications and may provide options for a user who isotherwise unable to respond to an event in an application adequately.For example, at various times during a message conversation, users maynot be able to provide sufficient attention and/or focus to respond toevents with pertinent commands or messages, and/or may not be able toprovide detailed user input to a user device to create such pertinentcommands or messages. In some examples, a user may be performing anactivity or be in an environment where appropriate responses are notpossible or more difficult for the user to provide.

One or more features described herein advantageously provide automaticselectable suggested response items for a user in response to particularevents in the embedded application or messaging application. Thesuggested response items are relevant to detected events on the device.Selection of such suggested items allows a user to simply and quicklyrespond to events with reduced user input and reduced time to composethe responses on a device, thus reducing consumption of device resourcesthat would otherwise be needed to display a large set of possibleresponses and/or reducing consumption of device resources needed toenable and process added input from the user to compose responses,search through, edit, or complete responses, and/or otherwiseparticipate in conversations held via electronic devices. Consequently,a technical effect of one or more described implementations is thatcreation and transmission of responses in device-implementedconversations is achieved with less computational time and resourcesexpended to obtain results. For example, a technical effect of describedtechniques and features is a reduction in the consumption of systemprocessing resources utilized to display, create, and send messageresponses and command responses as compared to a system that does notprovide one or more of the described techniques or features, e.g., asystem that uses prior techniques in which additional computationalresources are needed to receive input from the user used to specify,select, edit, or create responses that a user is to transmit.

Described techniques provide additional advantages. In some examples,user statuses or roles can be automatically assigned efficiently basedon information passed between messaging application and embeddedapplication without receiving additional user input. In some examples,user commands and comments can be sent to a server, and server eventscan be received and presented by an embedded application on a userdevice, without the user having to access the server by exiting a chatinterface and executing a separate application on the user device. Botscan be used in conjunction with embedded applications, e.g., to searchfor content items to be played by an embedded application and withoutthe user expending system resources to perform manual searching,selection, and initiation of applications. In other examples, usercomments can be stored that were previously input by users inassociation with content items previously played in an embeddedapplication. Such stored comments can be displayed in association withthe a later playback of the content items if the playback occurs in thesame chat conversation (or group of chat users), thus saving chat usersfrom re-entering comments during the later playback and reducingexpenditure of system resources. Synchronization techniques allowplayback of content items on user devices of an embedded session to besynchronized automatically and to be receptive to input from multipleusers. Such techniques allow chat users to share an experience in a chatconversation without the users using additional system resources toexecute separate applications or manually indicate playback positions toeach other.

In situations in which certain implementations discussed herein maycollect or use personal information about users (e.g., user data,information about a user's social network, user's location and time atthe location, user's biometric information, user's activities anddemographic information), users are provided with one or moreopportunities to control whether information is collected, whether thepersonal information is stored, whether the personal information isused, and how the information is collected about the user, stored andused. That is, the systems and methods discussed herein collect, storeand/or use user personal information specifically upon receivingexplicit authorization from the relevant users to do so. For example, auser is provided with control over whether programs or features collectuser information about that particular user or other users relevant tothe program or feature. Each user for which personal information is tobe collected is presented with one or more options to allow control overthe information collection relevant to that user, to provide permissionor authorization as to whether the information is collected and as towhich portions of the information are to be collected. For example,users can be provided with one or more such control options over acommunication network. In addition, certain data may be treated in oneor more ways before it is stored or used so that personally identifiableinformation is removed. As one example, a user's identity may be treatedso that no personally identifiable information can be determined. Asanother example, a user device's geographic location may be generalizedto a larger region so that the user's particular location cannot bedetermined.

An image as referred to herein is a digital image having pixels with oneor more pixel values (e.g., color values, brightness values, etc.). Animage can be a still image or single image, or can be an image includedin a series of images, e.g., a frame in a video sequence of videoframes, or an image in a different type of sequence or animation ofimages. A video includes a sequence of multiple images. For example,implementations described herein can be used with single images orstatic images (e.g., a photograph, an emoji, or other image), videos, oranimated images (e.g., cinemagraphs or other animated image thatincludes motion, a sticker that includes animation and audio, etc.).Text, as referred to herein, can include alphanumeric characters,emojis, symbols, or other characters.

FIG. 1 illustrates a block diagram of an example environment 100 forproviding messaging services that enable embedded applications asdescribed herein. In some implementations, automatic assistive agents,e.g., bots, can be provided. The exemplary environment 100 includesmessaging server 101, one or more client devices 115 a, 115 n, server135, embedded application server 150, session server 152, content server154, suggestion server 156, and network 140. Users 125 a-125 n may beassociated with respective client devices 115 a, 115 n. Server 135 maybe a third-party server, e.g., controlled by a party different from theparty that provides messaging services. In various implementations,server 135 may implement bot services, as described in further detailbelow. In some implementations, environment 100 may not include one ormore servers or devices shown in FIG. 1 or may include other servers ordevices not shown in FIG. 1. In FIG. 1 and the remaining figures, aletter after a reference number, e.g., “115 a,” represents a referenceto the element having that particular reference number. A referencenumber in the text without a following letter, e.g., “115,” represents ageneral reference to implementations of the element bearing thatreference number.

In the illustrated implementation, messaging server 101, client devices115, server 135, and servers 150-156 are communicatively coupled via anetwork 140. In various implementations, network 140 may be aconventional type, wired or wireless, and may have numerous differentconfigurations including a star configuration, token ring configurationor other configurations. Furthermore, network 140 may include a localarea network (LAN), a wide area network (WAN) (e.g., the Internet),and/or other interconnected data paths across which multiple devices maycommunicate. In some implementations, network 140 may be a peer-to-peernetwork between user devices and/or between other devices, e.g., usingpeer-to-peer data exchange techniques enabling offline communication(and usage of embedded applications as described below). Networkcommunication can include use of appropriate communication protocols(e.g., websockets allowing communication of bi-directional, full duplexmessages between devices such as a client (user) device and server).Network 140 may also be coupled to or include portions of atelecommunications network for sending data in a variety of differentcommunication protocols. In some implementations, network 140 includesBluetooth® communication networks, Wi-Fi®, or a cellular communicationsnetwork for sending and receiving data including via short messagingservice (SMS), multimedia messaging service (MMS), hypertext transferprotocol (HTTP), direct data connection, email, etc. In other examples,sound waves can be used in network 140 for data and state exchangebetween devices. Although FIG. 1 illustrates one network 140 coupled toclient devices 115, messaging server 101, server 135, and servers150-156, in practice one or more networks 140 may be coupled to theseentities.

Messaging server 101 may include a processor, a memory, and networkcommunication capabilities. In some implementations, messaging server101 is a hardware server. In some implementation, messaging server 101may be implanted in a virtualized environment, e.g., messaging server101 may be a virtual machine that is executed on a hardware server thatmay include one or more other virtual machines. Messaging server 101 iscommunicatively coupled to the network 140 via signal line 102. Signalline 102 may be a wired connection, such as Ethernet, coaxial cable,fiber-optic cable, etc., or a wireless connection, such as Wi-Fi,Bluetooth, or other wireless technology. In some implementations,messaging server 101 sends and receives data to and from one or more ofclient devices 115 a-115 n, server 135, one or more of servers 150-156,and bot 113 via network 140. In some implementations, messaging server101 may include messaging application 103 a that provides clientfunctionality to enable a user (e.g., any of users 125) to exchangemessages with other users and/or with a bot. Messaging application 103 amay be a server application, a server module of a client-serverapplication, or a distributed application (e.g., with a correspondingclient messaging application 103 b on one or more client devices 115).

Messaging server 101 may also include database 199 which may storemessages exchanged via messaging server 101, group data, e.g.,indicating which users are in which messaging groups (e.g., chatconversations) and which content data (video data, images, audio datawith group likes, game data, content documents, etc.) is associated withwhich messaging groups, data and/or configuration of one or more bots,information provided by content classifier 130, and user data associatedwith one or more users 125, all upon explicit permission from arespective user to store such data. In some embodiments, messagingserver 101 may include one or more assistive agents, e.g., bots 107 aand 111. In other embodiments, the assistive agents may be implementedon the client devices 115 a-n and not on the messaging server 101.

In some implementations, messaging server 101, messaging application103, and/or embedded applications running in association with amessaging application can provide messages in one messaging group (e.g.,chat conversation), and/or can send messages to one or more othermessaging groups (chat conversations) implemented by the messagingserver 101 (or other messaging server).

Messaging application 103 a may be code and routines operable by theprocessor to enable exchange of messages among users 125 and one or morebots 105, 107 a, 107 b, 109 a, 109 b, 111, and 113. In someimplementations, messaging application 103 a may be implemented usinghardware including a field-programmable gate array (FPGA) or anapplication-specific integrated circuit (ASIC). In some implementations,messaging application 103 a may be implemented using a combination ofhardware and software.

In various implementations, when respective users associated with clientdevices 115 provide consent for storage of messages, database 199 maystore messages exchanged between one or more client devices 115. In someimplementations, when respective users associated with client devices115 provide consent for storage of messages, database 199 may storemessages exchanged between one or more client devices 115 and one ormore bots implemented on a different device, e.g., another clientdevice, messaging server 101, and server 135, etc. In theimplementations where one or more users do not provide consent, messagesreceived and sent by those users are not stored.

In some implementations, messages may be encrypted, e.g., such that onlya sender and recipient of a message can view the encrypted messages.Some implementations can store encrypted data generated from users,e.g., user-generated content data such as messages, comments, recordeduser actions, etc. The user-generated content data can be encryptedlocally on the user device (e.g., in local execution of an embeddedapplication) and on a server system (e.g., for information communicatedfor a shared embedded application and an embedded session). In someimplementations, messages are stored. In some implementations, database199 may further store data and/or configuration of one or more bots,e.g., bot 107 a, bot 111, etc. In some implementations when a user 125provides consent for storage of user data (such as social network data,contact information, images, etc.) database 199 may also store user dataassociated with the respective user 125 that provided such consent.

In some implementations, messaging server 101 and messaging application103 can be implemented on one or more chat devices (e.g., user devices)participating in a chat conversation as described herein.

In some implementations, messaging application 103 a/103 b may provide auser interface that enables a user 125 to create new bots. In theseimplementations, messaging application 103 a/103 b may includefunctionality that enables user-created bots to be included in chatconversations between users of messaging application 103 a/103 b.

Servers 150-156 may include one or more processors, memory and networkcommunication capabilities. In some implementations, the servers arehardware servers. Signal lines 160, 162, 164, and 166 connect theservers 150, 152, 154, and 156 to the network 140, respectively, and maybe wired connections, such as Ethernet, coaxial cable, fiber-opticcable, etc., or wireless connections, such as Wi-Fi, Bluetooth, or otherwireless technology. In some implementations, servers 150-156 sends andreceive data to and from one or more of the messaging server 101 and theclient devices 115 a-115 n via the network 140. Although servers 150-156are illustrated as being individual servers, one or more of the servers150-156 can be combined and/or included in one or more other componentsof the environment 100, e.g., messaging server 101, client device 115 a,server 135, etc. Any or all of servers 150-156 may be managed by thesame party that manages the messaging server 101, or may be managed by athird-party. In some implementations, a server 101, 135, and 150-156 canbe considered a remote server relative to a particular device when theserver communicates over the network 140 with that particular device.Similarly, in some implementations, client devices 115 can be consideredremote from a particular device if communicating over the network 140with that particular device. In various implementations, functions ofany of servers 101, 135, and 150-156 can be implemented on one or moreclient devices 115.

Embedded application server 150 is communicatively coupled to thenetwork 140 via signal line 160 and serves embedded applications asdescribed herein that are requested by a device for install on thedevice. For example, a user device can request to download an embeddedapplication in as a background process of an operating system ormessaging application, and the embedded application server 150 sends thedata to the client device to execute the embedded application on theclient device. In some implementations, the embedded application server150 can execute embedded applications in whole or in part and can sendoutput data from the embedded application to client devices for displayby one or more client devices.

Session server 152 is communicatively coupled to the network 140 viasignal line 162 and can be used in some implementations to handle andcoordinate data sent to and from multiple client devices participatingin an embedded session that connects multiple embedded applications(e.g., a shared embedded application) executing on client devicesconnected to the network 140. For example, session server 152 can beused to manage an embedded session, e.g., including one or more ofsynchronizing the states of embedded applications in an embeddedsession, determine and distribute events on a corresponding embeddedapplication executing on the session server, etc. In someimplementations, the session server can determine one or more events forthe embedded session, one or more of which may occur at the sessionserver or other server in communication with the session server. Forexample, an event may include a server receiving user selection,comments, or ratings associated with content items served by the serverto user devices, and those content items may be played in an embeddedsession, such that the event can be conveyed to the embedded session. Insome implementations, the session server 152 can be included in or bethe same as messaging server 101 or other server of the environment 100.

Content server 154 is communicatively coupled to the network 140 viasignal line 164 and can be used to send content data to one or moredevices connected to the network 140. For example, the content data canbe data provided for output by embedded applications that displayembedded interfaces on client devices as described herein. The contentdata can include video data, image data, audio data, document data,webpage data, game data, bot data or information, map data or othergeographic information, etc. The content data can be included indifferent content items (media items), e.g., videos or movies, images,games, documents, webpages, etc.

Suggestion server 156 is communicatively coupled to the network 140 viasignal line 166 and can be used to determine and provide suggestedresponse items in reply to messaging applications and/or embeddedapplications for display and selection by users at client devices. Forexample, a messaging application running at a client device 115 can senddescriptive information to the suggestion server 156, and the suggestionserver 156 can consult databases, knowledge graph, and/or other dataresources to determine one or more suggested response items (alsoreferred to as “suggested items,” “suggested input items,” or “suggestedinput items” herein) in response to the descriptive information. Suchsuggested items can be suggested commands and suggested messages asdescribed with reference to FIG. 7. In some implementations, thefunctions of suggestion server 156 can be included within a messagingapplication and/or an embedded application.

In some implementations, the suggestion server 156 and/or othercomponents of the environment 100 can use machine learning, e.g., use amachine learning model that utilizes machine learning to determinesuggested items. For example, in a training stage the suggestion server(or other component) can be trained using training data (e.g., messagetraining data) of actual or generated messages in a messagingapplication context, and then at an inference stage can determinesuggested items to new messages or other data it receives. For example,the machine learning model can be trained using synthetic data, e.g.,data that is automatically generated by a computer, with no use of userinformation. In some implementations, the machine learning model can betrained based on sample data, e.g., sample message data, for whichpermissions to utilize user data for training have been obtainedexpressly from users providing the message data. For example, sampledata may include received messages and responses that were sent to thereceived messages. Based on the sample data, the model can predictmessage responses to received messages, which may then be provided assuggested items. In some implementations, the suggestion server 156 (orother component) can use one or more of a deep learning model, alogistic regression model, a Long Short Term Memory (LSTM) network,supervised or unsupervised model, etc. Some implementations can alsodetect image features in images or videos and determine suggested items(e.g., message responses) based on the image features. For example,image features can include people (without determining identity of thepeople), animals, objects (e.g., articles, vehicles, etc.), particularmonuments, landscape features (e.g., foliage, mountains, lakes, sky,clouds, sunrise or sunset, buildings, bridges, etc.), weather, etc.Various image recognition and detection techniques can be used (e.g.,machine learning based on training images, comparison to referencefeatures in reference images, etc.) to detect image features.

In some implementations, one or more of the servers 150-156 host bots.The bots may be computer programs that perform specific functions toprovide suggestions, for example, a reservation bot makes reservations,an auto-reply bot generates reply message text, a scheduling botautomatically schedules calendar appointments, etc. A server 150-156 mayprovide or refer one or more bots as its output to a messagingapplication 103. For example, the code for the bot may be incorporatedinto the messaging application 103, or the messaging application 103 maysend requests to a bot implemented at a server 150-156. In someimplementations, the messaging application 103 acts as an intermediarybetween the user 125 and a server 150-156 by providing the server150-156 with bot commands and receiving output (e.g., embeddedapplication data, session data, content data, suggested items, etc.)based on the bot commands.

In some implementations, one or more of the servers 150-156 (e.g.,content server 154 and/or suggestion server 156) may maintain anelectronic encyclopedia, a knowledge graph, one or more databases, asocial network application (e.g., a social graph, a social network forfriends, a social network for business, etc.), a website for a place orlocation (e.g., a restaurant, a car dealership, etc.), a mappingapplication (e.g., a website that provides directions), etc. Forexample, content server 154 may receive a request for information from amessaging application 103, perform a search, and provide the informationin the request. In some implementations, content server 154 may includeclassifiers of particular types of content in images, and can determinewhether any of particular classes are detected in the content (e.g.,pixels) of the image. In some examples, the messaging application 103may request driving directions or an estimated time of arrival from amapping application accessed by content server 154.

In some implementations, if a user consents to the use of such data, oneor more servers 150-156 (e.g., content server 154) may provide amessaging application 103 with profile information or profile images ofa user that the messaging application 103 may use to identify a personin an image with a corresponding social network profile. In anotherexample, content server 154 may provide the messaging application 103with information related to entities identified in the messages used bythe messaging application 10, if user consent has been obtained forprovided user data. For example, the content server 154 may include oraccess an electronic encyclopedia that provides information aboutlandmarks identified in the images, an electronic shopping website thatprovides information for purchasing entities identified in the messages,an electronic calendar application that provides, subject to userconsent, an itinerary from a user identified in a message, a mappingapplication that provides information about nearby locations where anentity in the message can be visited, a website for a restaurant where adish mentioned in a message was served, etc. In some implementations,the content server 154 may communicate with the suggestion server 156 toobtain information. The content server 154 may provide requestedinformation to the suggestion server 156.

In some implementations, one or more servers 150-156 may receiveinformation from one or more messaging applications 103, e.g., to updatedatabases used or maintained by these modules. For example, where thecontent server 154 maintains a website about a restaurant, the messagingapplication 103 may provide the content server 154 with updatedinformation about the restaurant, such as a user's favorite dish at therestaurant.

Server 135 may include a processor, a memory and network communicationcapabilities. In some implementations, server 135 is a hardware server.Server 135 is communicatively coupled to the network 140 via signal line128. Signal line 128 may be a wired connection, such as Ethernet,coaxial cable, fiber-optic cable, etc., or a wireless connection, suchas Wi-Fi, Bluetooth, or other wireless technology. In someimplementations, server 135 sends and receives data to and from one ormore of messaging server 101 and client devices 115 via network 140.Although server 135 is illustrated as being one server, variousimplementations may include one or more servers 135. Server 135 mayimplement one or more bots as server applications or server modules,e.g., bot 109 a and bot 113.

In various implementations, server 135 may be part of the same entitythat manages messaging server 101, e.g., a provider of messagingservices. In some implementations, server 135 may be a third partyserver, e.g., controlled by an entity different than the entity thatprovides messaging application 103 a/103 b.

In some implementations, server 135 provides or hosts bots. A bot is anautomated service, implemented on one or more computers, that usersinteract with primarily through text, e.g., via messaging application103 a/103 b. Bots are described in greater detail below.

Client device 115 may be a computing device that includes a memory and ahardware processor, for example, a camera, a laptop computer, a tabletcomputer, a mobile telephone, a wearable device, a mobile email device,a portable game player, a portable music player, a reader device, headmounted display or other electronic device capable of wirelesslyaccessing network 140.

In the illustrated implementation, client device 115 a is coupled to thenetwork 140 via signal line 108 and client device 115 n is coupled tothe network 140 via signal line 110. Signal lines 108 and 110 may bewired connections, e.g., Ethernet, or wireless connections, such asWi-Fi, Bluetooth, or other wireless technology. Client devices 115 a,115 n are accessed by users 125 a, 125 n, respectively. The clientdevices 115 a, 115 n in FIG. 1 are used by way of example. While FIG. 1illustrates two client devices, 115 a and 115 n, the disclosure appliesto a system architecture having one or more client devices 115.

In some implementations, client device 115 may be a wearable device wornby a user 125. For example, client device 115 may be included as part ofa clip (e.g., a wristband), part of jewelry, or part of a pair ofglasses. In another example, client device 115 can be a smartwatch. Invarious implementations, user 125 may view messages from the messagingapplication 103 a/103 b on a display of the device, may access themessages via a speaker or other output device of the device, etc. Forexample, user 125 may view the messages on a display of a smartwatch ora smart wristband. In another example, user 125 may access the messagesvia headphones (not shown) coupled to or part of client device 115, aspeaker of client device 115, a haptic feedback element of client device115, etc.

In some implementations, messaging application 103 b is stored on aclient device 115 a. In some implementations, messaging application 103b (e.g., a thin-client application, a client module, etc.) may be aclient application stored on client device 115 a with a corresponding amessaging application 103 a (e.g., a server application, a servermodule, etc.) that is stored on messaging server 101. For example,messaging application 103 b may transmit messages created by user 125 aon client device 115 a to messaging application 103 a stored onmessaging server 101.

In some implementations, messaging application 103 a may be a standaloneapplication stored on messaging server 101. A user 125 a may access themessaging application 103 a via a web page using a browser or othersoftware on client device 115 a. In some implementations, messagingapplication 103 b that is implemented on the client device 115 a mayinclude the same or similar modules as that are included on messagingserver 101. In some implementations, messaging application 103 b may beimplemented as a standalone client application, e.g., in a peer-to-peeror other configuration where one or more client devices 115 includefunctionality to enable exchange of messages with other client devices115. In these implementations, messaging server 101 may include limitedor no messaging functionality (e.g., client authentication, backup,etc.). In some implementations, messaging server 101 may implement oneor more bots, e.g., bot 107 a and bot 111.

In various implementations, messaging application 103 may include one ormore embedded applications 117 that are executed in association with anddependent on the messaging application 103. An embedded application 117can interact with a chat interface of the messaging application andprovide one or more of its own embedded interfaces. Examples of variousfeatures of embedded applications are described herein.

In some implementations, messaging application 103 a/103 b may provideone or more suggested items, e.g., suggested commands, messages, orresponses, to users 125 via a user interface, e.g., as a button, orother user interface element. Suggested items may enable users torespond quickly to messages when the user selects a suggested item,e.g., by selecting a corresponding user interface element on atouchscreen or via other input device. Suggested items may enable fasterinteraction, e.g., by reducing or eliminating the need for a user totype a response. Suggested items may enable users to respond to amessage or provide a command quickly and easily, e.g., when a clientdevice lacks text input functionality (e.g., a smartwatch that does notinclude a keyboard or microphone). In some implementations, suggestedresponses may be generated using predictive models, e.g., machinelearning models, that are trained to generate responses. Suggested itemsare described in greater detail below with respect to FIG. 7.

FIG. 2 is a flow diagram illustrating an example method 200 to provide aprogram embedded in a chat conversations, according to someimplementations. In some implementations, method 200 can be implemented,for example, on a server system, e.g., messaging server 101, as shown inFIG. 1. In some implementations, some or all of the method 200 can beimplemented on a system such as one or more client devices 115 as shownin FIG. 1, and/or on both a server system and one or more clientsystems. In described examples, the implementing system includes one ormore processors or processing circuitry, and one or more storage devicessuch as a database or other accessible storage. In some implementations,different components of one or more servers and/or clients can performdifferent blocks or other parts of the method 200.

In block 202, it is checked whether user consent (e.g., user permission)has been obtained to use user data in the implementation of method 200.For example, user data can include messages sent or received by a user,e.g., using messaging application 103, user preferences, user biometricinformation, user characteristics (identity, name, age, gender,profession, etc.), information about a user's social network andcontacts, social and other types of actions and activities, content,ratings, and opinions created or submitted by a user, a user's currentlocation, historical user data, images generated, received, and/oraccessed by a user, videos viewed or shared by a user, etc. One or moreblocks of the methods described herein may use such user data in someimplementations.

If user consent has been obtained from the relevant users for which userdata may be used in the method 200, then in block 204, it is determinedthat the blocks of the methods herein can be implemented with possibleuse of user data as described for those blocks, and the method continuesto block 208. If user consent has not been obtained, it is determined inblock 206 that blocks are to be implemented without use of user data,and the method continues to block 208. In some implementations, if userconsent has not been obtained, blocks are to be implemented without useof user data and with synthetic data and/or generic orpublicly-accessible and publicly-usable data.

Implementations described herein may provide embedded applicationprograms that are executed in association with messaging applicationsproviding chat conversations in chat interfaces. The messagingapplication may be a messaging application 103 as described above, andmay execute wholly or in part on a user device (e.g., client device orother device), or may execute wholly or in part on a server (e.g.,messaging server 101) and provide data to the user device to display atthe user device.

In some examples, messaging application 103 may be an instant messagingapplication, a social network application, an email application, amultimedia messaging application, and the like. For example, if themessaging application is an instant messaging application, messages maybe received as part of an instant messaging communication between aparticular user 125 a and one or more other users 125 of participatingdevices, e.g., in a messaging session (e.g., chat, group, or “chatconversation”) having two or more participants, etc. A chat, or chatconversation, is a messaging session in which multiple participatingusers communicate messages (e.g., including various types of contentdata) with each other. In some implementations, users may send messagesto other users by inputting messages into a chat conversationimplemented by a messaging application. In some implementations, usersmay send messages to particular other users by messaging a phone number(e.g., when the messaging application 103 works over SMS, or anothermessaging application that utilizes phone numbers) or selecting arecipient user from a contacts list (e.g., when the messagingapplication 103 works over rich communications services (RCS) or anotherchat interface). In some implementations, messaging application 103 mayprovide real-time communication between participating devices, e.g.,audio (voice) calls and/or video calls, where real-time audio dataand/or video data is captured at one or more participating devices(e.g., using a camera and microphone), and this data is sent to andoutput in chat interfaces (and speakers) of the other devicesparticipating in a chat conversation (e.g., conference call).

The messaging application 103 may display a chat interface that displaysmessages of the chat conversation, e.g., messages sent by the user ofthe user device, and messages received by the user device from otherdevices. As referred to herein, a chat interface has a user interfacecomponent that is displayed (e.g., including displayed interfaceelements), as well as having a data reception and exchange componentthat performs receiving of user input, sending and receiving messages,displaying of messages, etc.

In implementations described herein, one or more embedded applicationscan be executed in association with a messaging application. An embeddedapplication herein refers to a messaging-embedded or chat-embeddedprogram, e.g., a program that is executed in association with, or withina context of, a running messaging application and is dependent on theexecution of the messaging application. For example, an embeddedapplication is code (e.g., a script) able to be executed on a device ifa messaging application is currently providing output (e.g., a chatinterface) on the device, and the embedded application is exited (e.g.,no longer executing on the device) if the messaging application isexited and no longer provides output on the device. For example, in someimplementations, an embedded application can receive input provided toor in an embedded interface, e.g., selections of user interfaceelements, text, or other displayed objects in the embedded interface,gestures of an input device (such as taps, tracings of shapes, curves,or lines, etc. on a touch-sensitive input surface of a touchscreen,touchpad, etc.), and/or other user input received by the embeddedinterface via touchscreen or other input device. As referred to herein,an embedded interface includes a displayed component, which can includea user interface component (e.g., displayed user interface elements) aswell as displayed output data including content data, e.g., media itemcontent data, game data, document data, user comments, messages, etc.The embedded interface also includes a data reception component thatperforms receiving of user input at the user device, e.g., via atouchscreen, keyboard, or other input device by a user. In someimplementations, the embedded interface is displayed in association withthe chat interface. For example, the embedded interface can be displayedas part of the chat interface, e.g., within the borders or display areaof the chat interface, partially overlapping the chat interface, oradjacent to the chat interface. In some implementations, at least aportion of the chat interface is visible and the embedded interface isvisible on the display.

In some implementations, the embedded application can receive inputprovided in the associated chat interface for the associated chatconversation, e.g., as text commands or selection of chat interfaceelements. In some implementations, an embedded application providesoutput in the embedded interface, and/or can provide output in the chatinterface, e.g., provides output as text to a chat conversationdisplayed in the chat interface or provides other chat interface output.For example, output of the embedded application to the embeddedinterface can be referred to as embedded output data, and can includedata generated by the embedded application and/or data that the embeddedapplication has received from one or more other sources via theassociated messaging application (e.g., sources including a differentapplication program executing on the first device, one or more serversconnected over the network, one or more chat devices in a chatconversation of the associated messaging application, etc.). Data sentfrom the embedded application to other application programs and/or otherdevices can be provided from the embedded application to the messagingapplication, which then conveys the data (or a processed form of thedata) to other programs or devices. Similarly, data received at a userdevice from other programs or devices, to be provided to an embeddedapplication executing for that user device, can be received by themessaging application and provided from the messaging application to theembedded application.

Some examples of embedded applications are described throughout thedescription. In some example implementations, an embedded applicationcan be code executed within a sandboxed display procedure to displayapplication data and an embedded interface, e.g., within display area ofa chat interface or in other visual association with a chat interface.For example, in some implementations, an embedded application canimplement a web interface view to provide an embedded interface withinthe chat interface, where the view can display data from a web pageand/or implement code that executes in connection with web pages(Javascript, CSS, HTML, etc.). In some implementations, embeddedapplications can be supplied by a third party, e.g., a different partythan the party that supplies the associated messaging application and/orother components communicating with the embedded application. In someimplementations, buffering (e.g., double buffering techniques) can beprovided when transitioning from the display of one embedded applicationto a different embedded application. For example, embedded applicationcode and/or output data for a second embedded application that is notbeing displayed can be downloaded, installed, and/or loaded into memoryfor display in the background of an operating system of a device while afirst embedded (or other) application and embedded interface aredisplayed and used in the foreground. The first, displayed embeddedinterface can be swapped with the second embedded interface viadisplayed animations and user interface transitions. In some examples,when an embedded application is being downloaded, a loading indicatorcan be displayed while the code is being downloaded and/or installed onthe user device in the background.

In some examples, the embedded application can communicate and interfacewith a framework implemented by the messaging application using anapplication program interface (API) that provides a set of predefinedprotocols and other tools to enable the communication. For example, theAPI can be used to communicate particular data from devicesparticipating in an embedded session (e.g., member devices), where thedata connects and synchronizes the embedded application programs (e.g.,shared embedded application) of the embedded devices. In someimplementations, the messaging application framework can provide a setof APIs to provide embedded-application developers capabilities toenable interactions between a chat conversation, a device, an embeddedsession, and the embedded application.

In some example implementations, if a member user exits an embeddedapplication, that embedded application can be kept executing in thebackground of the member device of that member user, e.g., thebackground of the messaging application or operating system of themember device, for a period of time (e.g., 20 seconds, 1 minute, etc.).For example, this can be performed in case the user switches back tousing the embedded application soon after interacting with the chatinterface. In some examples, the user can open an embedded gameapplication, input a move to the game, close the embedded gameapplication and embedded interface (so that they execute in thebackground), send or attach a file into the chat conversation inresponse to another user's request, and immediately re-open the embeddedgame application and embedded interface to switch them to theforeground. The background-running embedded application can beterminated if the chat conversation is ended, e.g., if the user closesthe messaging application or, in some implementations, switches to adifferent chat conversation. Similarly, if the messaging application isclosed or exited by the user, the messaging application can be sent tothe background of the user device for a particular time period, and theactive embedded application can be paused during this time. The user canswitch to using another application, and then resume use of the embeddedapplication when the messaging application is selected to execute in theforeground. Thus, embedded applications can be tied to the lifecycle ofthe chat conversation.

In various implementations, one or more of the users may be bots. Forexample, a chat user or member user as referred to herein can be a botin some implementations. In such a case, the “user device” associatedwith the “chat user” (bot) can be a server device that provides the bot.In some examples, the bot can be an assistant bot, a shopping bot, asearch bot, etc. In some implementations, bots may be automated agentsthat are implemented in software and/or hardware. In someimplementations, bots may represent or be associated with cameras (e.g.,security cameras, web cameras, surveillance cameras, etc.), appliances(e.g., a smart refrigerator, an alarm device, an industrial appliance,etc.), imaging devices (e.g., microscopes, medical imaging devices,etc.) and send one or more images via messaging application 103. In theimplementations that include one or more of the users that are bots,consent is obtained from an owner or operator of the bot to use messagesgenerated by the bot. In some implementations, consent may be specifiedas a configuration parameter of the bot, camera, appliance, etc. and beprovided to the messaging application 103 upon the bot interacting withthe messaging application 103.

In block 208, a first messaging application is caused to display a firstchat interface on a first user device. The chat interface is a userinterface configured to receive information and output informationrelated to one or more chat conversations in which the first device canparticipate. For example, the chat interface can be displayed on adisplay device of the first device, e.g., a display screen, in responseto user input from a first user using or otherwise associated with thefirst device or other input. In some implementations, the firstmessaging application executes on the first device, while in otherimplementations, the first messaging application can execute partiallyor wholly on a different device connected to the first device via anetwork (e.g., a messaging server) and can send data to the first deviceto be displayed by the first device.

The first user and first device can join one or more chat conversationsusing the chat interface. For example, user input from a user of thefirst device can initiate a new chat conversation with one or more otherusers using user devices, and/or join an existing chat conversation withone or more other users and devices communicating over a network. Eachchat conversation includes a group of chat users (and their associateduser devices) who are participating in that particular chatconversation. In some implementations, a user can be concurrentlyparticipating in multiple different chat conversations. In someimplementations, each chat user is associated with a respective chatidentity in a chat conversation. A chat identity can refer to a visualrepresentation of the user in the chat interface (e.g., depiction of auser's head, username, user image, etc.). The chat identity includestext, image, or multimedia data effective to depict the chat user (e.g.,a user photo, a user icon, a username, an animation depicting the chatuser, etc.) A chat identity can also or alternatively refer to a useridentifier (e.g., identification (ID) data, ID number, etc.). The chatidentity includes a unique identifier for the chat user in the contextof the messaging application. For example, the unique identifier may bethe username. In another example, the unique identifier may be anidentifier for a database of chat users (e.g., a primary key for adatabase table that stores user identities). In providing a chatidentity to an embedded application, the database identifier or usernamemay be provided.

In some implementations, a chat conversation can be considered a chatgroup of users, and may have an ongoing existence whether or not itsusers are currently participating in the chat conversation or arecurrently logged in or using a user device. For example, if all the chatusers exit the chat conversation, a conversation identifier (ID), andthe chat identities and user identities of the chat conversation can bestored by the messaging application, and the chat conversation can beresumed when one or more of the chat users log in or resume theconversation using the chat interface. Some implementations of themessaging application can assign and store a conversation ID thatidentifies a particular chat conversation, and store identities of theassociated current chat users (and/or chat devices) in association withthe conversation ID. In some implementations, new users can be added toa chat conversation, and one or more users can be removed from a chatconversation.

The chat interface can display information of each chat conversation inwhich the first user is participating, including messages received bythe first device from other chat devices and chat users participating inthe chat conversation, as well as information related to statuses ofchat users, options for message functions, events occurring in the chatconversation, etc. The chat interface can include interface featuresallowing a user of or associated with the first device (e.g., a firstuser) to provide user input, including interface elements to enable suchfeatures. For example, a user can compose messages on the first deviceand input the messages to a chat conversation. In some examples, a usercan provide user input to the chat interface via touchscreen, physicalbuttons or keyboard, voice input, or other types of input.

In block 210, input is received by the first device that selects a firstembedded application to initiate (e.g., to open or execute the embeddedapplication on the first device) and to be shared with chat users. Theinput can be user input received from the first user locally at thefirst device. In some examples, a menu or other set of options listingavailable embedded applications can be displayed (or otherwise presentedor output) by the first device, and user input can select the firstembedded application from the options. The first embedded application isassociated with a particular chat conversion that is currently active inthe message application. For example, in some implementations, one ormore options to select and open the first embedded application can bedisplayed or otherwise enabled in the chat interface displaying aparticular chat conversation, and selection of such an option causes thefirst embedded application to run in association with that chatconversation. In some additional examples, the user input can includeone or more text commands input in the chat interface as if part of acomposed message, where the text commands are received as a command toselect the first embedded application to initiate. In some examples,text preceded by a particular syntax character(s) or other predefinedformat can indicate such a command.

In some implementations, the input that selected the first embeddedapplication to open can also specify that the first embedded applicationis to be shared with one or more other chat users and user devicesparticipating in an associated chat conversation. This sharing selectionallows an embedded session to be created (see block 214 below) betweenthe first device and one or more other devices executing local versionsof the embedded application and participating in the chat conversation.In some implementations, the first embedded application can bealternately selected to open without sharing with other chat users,which would cause the first embedded application to be executed withoutinitiating an embedded session and without other devices receiving datarelated to the first embedded application. In some implementations, aselection to initiate an embedded application causes a shared embeddedsession to be initiated automatically (or based on stored userpreference data). In some implementations, an embedded application doesnot output display (e.g., in an embedded interface as in block 212below) until at least one other chat user has joined the embeddedsession associated with the first embedded application.

In block 212, the first embedded application is downloaded over thenetwork and/or executed on the first device and an embedded interface isdisplayed in association with the chat interface. For example, the firstembedded application can be downloaded in response to the selectionreceived in block 210. In some implementations, the first embeddedapplication can be downloaded from a server system hosting embeddedapplications, e.g., embedded application server 150. In someimplementations, the download of the first embedded application canoccur in the background of the operating environment of the firstdevice, e.g., as a background process of the messaging applicationand/or operating system of the first device. This allows programs andfeatures (such as the chat interface of the messaging application) toexecute, provide output on the first device, and/or be used by the firstuser during the download. After (and/or during) the first embeddedapplication is downloaded, it can be executed by the first device. Insome implementations, after the first embedded application has beendownloaded, it can remain stored in local non-volatile memory of thefirst user device, such that upon subsequent initiations of the firstembedded application, it is available from the local memory and is notdownloaded (e.g., unless updates are available for the first embeddedapplication). In some implementations, or more parts or components ofthe first embedded application can be executed by one or more otherdevices in communication with the first device, e.g., one or more serversystems. The embedded application code may be provided (e.g.,transmitted) specifically to those devices of users that have providedconsent for the system to access user data. In some implementations,because the embedded application is downloaded when initiated, regionaland/or time-sensitive embedded applications can be provided from theembedded application server in a particular download, e.g., specializedfor current holidays or calendar events, geographical regions, etc.Access to specialized embedded applications can be restricted based onthe particular geographical region, language, and/or othercharacteristics or restrictions of the user device and user that isreceiving the download.

In some implementations, the first embedded application causes anembedded interface to be displayed by the first device. The embeddedinterface is a user interface to the embedded application allowing userinput to be received in the embedded interface to be provided to thefirst embedded application, and allowing output from the first embeddedapplication to be displayed by the first device. In someimplementations, information from the first embedded application that isto be output to other devices over the network can be provided from theembedded application to the messaging application, and the messagingapplication can send the information from the first device over thenetwork to other devices.

In some examples, the embedded interface can be displayed in associationwith the chat interface on a display device of the first device suchthat at least a portion of the chat interface is visible, e.g., one ormore chat messages (such as newly input chat messages) in the chatinterface remain visible during display of the embedded interface. Forexample, the embedded interface can be displayed as part of the chatinterface, e.g., within a display area or borders of the chat interface,partially overlapping the chat interface, or adjacent to the chatinterface in some implementations. For example, the embedded interfacecan include an embedded view displayed within the chat interface. Insome examples, the embedded view can be a portion of the chat interfacethat is dedicated to displaying output data of running embeddedapplication(s) such as the first embedded application and/or dedicatedto receiving input to running embedded application(s) such as the firstembedded application. In some examples, the embedded view can be arectangular or other shaped window or other portion of the displayscreen.

In various implementations, an embedded interface can be displayed basedon an orientation of the user device, e.g., where a rotation of the userdevice to landscape mode causes the embedded interface to expand to afullscreen display, e.g., to allow a more immersive game experience,more screen space for an editing task, etc. In some implementations, ifan embedded interface is in a fullscreen mode providing a fullscreendisplay (and not in a partial-screen mode), chat messages input in thechat conversation by chat users can be displayed within the fullscreenembedded interface, e.g., as notifications (if the first user hasselected to display such chat messages in this way). In someimplementations, suggested responses (described with respect to FIG. 7)can also be displayed within the fullscreen embedded interface.

In some implementations, a size and/or shape of the embedded interfacecan be based on a type of the first user device, and/or a type ofinformation displayed by the first embedded application in the embeddedinterface. In some examples, if the first user device is a type that isa mobile device or other device having a small display area (e.g.,display screen), the embedded interface can be sized to occupy aparticular percentage of the display area and allow at least one chatmessage to be displayed in the chat interface. For a type of devicehaving a larger display area (e.g., desktop computer, larger tabletdevice, etc.), the embedded interface can be displayed to occupy asmaller percentage of the display area, allowing a larger area for chatmessages. In some implementations, in response to user input selecting adisplayed control, the embedded interface can be maximized to occupy theentire display area. In additional examples, if the embedded applicationis a media player application that displays a particular type of contentdata such as movie data and image data (or a game application displayinga particular type of game, e.g., with graphical environments), theembedded interface can be sized larger to view the content data, whileif the embedded application displays a type of content data such aslists of text items or outputs audio from audio data, the embeddedinterface can be sized smaller. In some implementations, the embeddedinterface can be displayed as a three-dimensional (3D) display by adisplay screen, virtual reality display device, etc., or can bedisplayed in augmented reality display device, etc.

In some implementations, setup parameters can be input to the embeddedapplication by the first user prior to initiating the embedded sessionand prior to sharing the embedded application with other chat users. Forexample, the first user can create a new game instance of an embeddedgame application and set up parameters of the game, select a playername, game board size, player color, the number of players allowed tojoin that particular session, etc. In further examples, the user cansearch a media item menu for a video to play, select a traveldestination, flight, hotel, etc. online using the embedded applicationbefore sharing the selected options, pre-select shopping items (clothes,furniture) before asking for opinion/votes by other member users, etc.

In block 214, a shared embedded session is initiated. The embeddedsession is a designated event dedicated to shared use of a sharedembedded application by a group of particular chat devices that areparticipating in the embedded session and in a chat conversation overthe network, e.g., a shared communication of information between theparticular chat devices and the shared embedded application. In someimplementations, each chat device of the embedded session executes, atleast in part, an instance of the shared embedded application (e.g., acorresponding embedded application). The group of associated chatdevices, and a group of the chat users that use the associated chatdevices, share user interactions with and output of the shared embeddedapplication. For example, one or more states of the correspondingembedded applications executing on the user devices of the group of chatusers are synchronized. In some implementations, the embedded sessionincludes only one or more chat devices from the chat conversation withwhich the first embedded application is associated, e.g., the chatconversation in which the first embedded application was opened in block210. Chat users that have joined an embedded session are “member users”and their chat devices are “member devices,” which are a subset of thechat devices that are participating in the embedded session. In someimplementations, the embedded session can be associated with aparticular embedded session identifier (ID) that is associated with theidentifier of the associated chat conversation. The session ID can beassociated with the current user members of that embedded session. Forexample, the user of the first device can be added to a session userlist for the embedded session, which lists the members of the embeddedsession. The first device and/or session server can store and updatesuch a session user list.

In some implementations, the embedded session can be managed by aserver, e.g., (embedded) session server 152, which can be a serversystem that receives data from one or more member devices participatingin the embedded session, synchronizes states of the embeddedapplications on the member devices, and outputs data to one or moremember devices. In this example, the first device (e.g., the firstmessaging application) can send data to the session server in responseto receiving the input in block 210 and/or in response to executing thefirst embedded application in block 212, where the data indicates to thesession server that the first embedded application has been initiated.In some implementations, the session server can initiate the embeddedsession in response to receiving this data and can executeapplication(s) that can perform some processing for the embedded session(e.g., store objects, perform processes, etc.). In some implementations,one or more client devices, e.g., the first device that initiated theembedded application of an embedded session, can manage the embeddedsession, and/or member devices can communicate messages between eachother without server processing. For example, data can be sent from eachmember device to a message router that relays the data to the othermember devices without processing that influences the embedded session.

In block 216, notification information is transmitted to other devicesof the chat conversation indicating that the embedded session is active.In some implementations, the notification information can be transmittedfrom the session server to other devices participating in the chatconversation (“chat devices”) over the network, e.g., to all chatdevices. In some implementations, notification information is generatedat the session server (or at the first message application) and sent tothe other chat devices via the session server. The notificationinformation can include the identification of the embedded session andthe identification of the chat conversation, as well as the list ofidentifications of session users who are currently members of theembedded session (which in this example is currently the first user).

In block 218, chat users are enabled to join and/or leave the embeddedsession, and chat devices can be notified of such joining and leavingevents. For example, the first device can transmit join information tothe one or more other user devices participating in the chatconversation (e.g., which can be included in the notification of block216 in some implementations, or can be transmitted separately from thenotification). The join information can cause display of an interfaceelement at the other chat devices that is receptive to user input ateach chat device. In response to receiving user input at the interfaceelement on a particular chat device, the particular device is designatedas a member device of the embedded session. In some exampleimplementations, chat users are enabled to join the embedded session asmember users by selecting a displayed “join” button presented on theiruser devices. In some implementations, a chat user can input a commandto join an embedded session, e.g., in response to a notification ofblock 216 being displayed on the chat user's device. Some examples of adevice joining an embedded session are described below with respect toFIGS. 3 and 4.

Member users can leave the embedded session by exiting or closing theembedded application and/or by exiting or closing the messagingapplication. In some implementations, exiting or closing the messagingapplication and/or embedded application does not trigger the user losingmembership in the embedded application or session. In such animplementations, users are still members of the embedded application,and are simply indicated as being offline, e.g., in a chat interface orembedded interface displayed on other member devices. In examples ofsuch implementations, users can leave the embedded session (discontinueembedded application membership) by leaving the chat conversation theembedded application is associated with. In some examples, chat devicesare sent a notification indicating that a user has joined or left anembedded session and the identity of the user (or user device). Thenotification can be sent to chat devices that may or may not be memberdevices of the embedded session. In some implementations, only thedevices of member users are sent the notification in response to amember user of the embedded session leaving the session.

Each of the member devices that has joined the embedded sessiondownloads and/or executes a respective embedded application(corresponding to the first embedded application and the embeddedsession) that provides a respective embedded interface associated with arespective chat interface displayed on the respective particular userdevice. The embedded applications of the member devices communicate witheach other in the embedded session over the network.

In block 220, the first embedded application executing on the firstdevice operates to receive input, update states, and provide output. Forexample, the input received by the first embedded application caninclude user input provided from the user of the first device. In someexamples, the user input can be received in a displayed embeddedinterface, e.g., to select elements displayed within the embeddedinterface, specify directional data with a controller or gesture,specify text data, etc. In additional examples, the user input can bereceived in the chat interface, e.g., text commands input as messages orselection of interface elements in the chat interface. Input received inthe chat interface can be processed and/or conveyed from the messagingapplication to the embedded application. In some implementations, theembedded application can have access to chat conversation information(e.g., user names or chat identities, user icons, etc.) and/or access touser profile information (user name, profile picture, chat obfuscatedID) which can allows for a personalized experience. In someimplementations, the embedded application does not have access to thechat stream (e.g., the chat messages input in the chat conversation). Inother implementations, the embedded application can have full access tothe chat stream, and/or the embedded application can requesthigher-level access to chat input (to be permitted by the user), and/orcan be provided summaries by the messaging application of chat messagesinput by chat users in the chat conversation. In additional examples,the embedded application can directly read the input chat messages froma chat conversation database associated with the chat conversation(e.g., stored on the user device or a server), and/or can receive chatmessages and other user input in the chat interface via a server or bot.The user input can be touchscreen input, text input provided from adisplayed keyboard or physical keyboard, commands provided from voiceinput, or other types of input.

Furthermore, the first embedded application can receive input (data)including event information received over the network from memberdevices of the embedded session. For example, event information caninclude user input provided by other member users to associated embeddedinterfaces displayed on their devices by embedded applications executingfor those devices and corresponding to the first embedded application.This user input and/or other data (e.g., updates to or states of theembedded application based on that user input), can be sent to the firstuser device over the network.

In addition, input can include event information indicating one or moreevents and/or application states occurring in one or more correspondingembedded applications executing on one or more other member devices(and/or a session server), and this event information can be sent to thefirst user device over the network. For example, the event informationcan describe events occurring within a corresponding embeddedapplication running on a particular device based on user input receivedby that embedded application, and this information is sent to the othermember devices to synchronize the embedded applications of the embeddedsession. In some implementations, the event information from othermember devices can be conveyed by a server system to the first embeddedapplication (e.g., the messaging server, session server, etc.). In someimplementations, input is received by the first messaging application ofthe first device, which provides the information to the first embeddedapplication.

Furthermore, the first embedded application can receive content datafrom one or more other devices (e.g., member devices, server systems,etc.) over the network. For example, if the first embedded applicationis a video playing application, it can receive a stream of video datafrom a content server over the network and display the video data in theembedded interface. If the first embedded application is a game, it canreceive game data from other member devices and/or a game server anddisplay game data in the embedded interface. If the first embeddedapplication displays a shared content document (e.g., list of items orevents, text document, etc.), travel itinerary, or other information, itcan receive the content data of these items from other member devicesand/or a server system and display the content data in the embeddedinterface. In some implementations, the content data is received by thefirst messaging application of the first device, which provides thecontent data to the first embedded application.

In some examples, the first embedded application is updated based on theinput. For example, the first embedded application can receive databased on input data received from the first user and/or one or moremember devices (and/or server system) that, e.g., change one or morestates of the embedded application. In some examples of changed states,playback of a media item may be updated to a different point in themedia item (e.g., a different time point in a video), a game may beupdated to one or more different game states (e.g., a state of the gameindicating a different position of a game piece or player character in agame environment, a state of the game indicating a win, loss, or changein a player's score, etc.), a shared list may be updated to add, remove,or change one or more items on the list, a reservation of a theater seatmay be input, changed in time or place, or removed, etc. Similarly,input can include event information describing an event of the embeddedsession (e.g., an event in a corresponding embedded application of amember device or a server providing data in the embedded session), suchas an event occurring in a game based on user input (e.g., a game eventdetermined by game code running at a different member device or aserver). This event information can cause the first embedded applicationto update its state to synchronize with the embedded session, e.g.,synchronize with one or more corresponding embedded applications. Insome implementations, other embedded applications of other memberdevices can be similarly updated based on the input received at therespective member devices and event information.

Output provided by the embedded application be based on received inputand/or events occurring in the embedded application. For example, theoutput can include output data displayed in the embedded interface. Forexample, the embedded interface can display interface elements, controlsand other features provided by the embedded application. In anotherexample, an embedded application can cause data to be displayed in theembedded interface to provide a graphical game environment, threedimensional (3-D) environment, etc. (such as display on a displayscreen(s), display by virtual reality and/or augmented reality displaydevices, etc.). In some implementations, the output can include datareceived by the first embedded application and the first device from adifferent device, e.g., content data received from a server such acontent server 154 or from a member device of the embedded session.

In some implementations, the output data displayed by the embeddedinterface can be customized for the particular user of the device onwhich it is displayed. For example, the first user may have stored userpreferences indicating a location, size, shape, etc. of the embeddedinterface on the display, and a user-preferred color scheme or othervisual features of output data displayed in the embedded interface. Insome examples, the first user may have stored user preferences specificto a particular embedded application, e.g., preferences indicating auser-preferred user status or role in a specified embedded application,a user-preferred interface element layout for particular types ofembedded applications, etc. Such preferences can, for example, beprovided from the messaging application to the embedded application andimplemented by the embedded application.

In some examples, the output provided from the first embeddedapplication can include visual updates to the embedded interface (e.g.,embedded view) displayed by the first device. For example, media dataplayable (e.g., image or video data) at a new time point can bedisplayed based on an update to that time point, one or more changes toa displayed game can be displayed, changes to a content document (list,document, chart, etc.) can be displayed, etc.

In further examples, the first embedded application can process contentdata from the chat conversation (e.g., parse and/or otherwise processchat messages provided by the messaging application) to present outputdata in the embedded interface, and/or an embedded interface itself,that is contextually relevant to one or more topics mentioned in theassociated chat conversation. For example, chat messages in theconversation may have included indications of a particular media item toplay, and that media item can be automatically selected and played bythe embedded application. In another example, the chat messages canindicate that a user desires to play on a particular side or team in agame, and the user can be automatically assigned to that team by theembedded application. Multiple visual appearances of the embeddedinterface (e.g. colors, visual styles, etc.), and/or different availableselections or controls displayed in the embedded interface, may beprovided in different versions of the embedded interface. For example,the embedded interface may be displayed in different versions fordifferent member devices, based on a user status or role of the user,type of media item played (e.g., video vs. image), etc.

In additional examples, an embedded application can summarizeconversations and automatically store important information that can bedisplayed at a later time. For example, a user can open a “summary”embedded application and the embedded application can display a summaryoverview of the messages input by chat users of a conversation over aperiod of time specified by the user and/or a period of time that theuser was offline, instead of (or in addition to) displaying a record ofmany chat messages to read.

In additional examples, the embedded application can be a “lightweight”(e.g., reduced-feature or reduced-functionality) version of a fullapplication that executes on the user device or on a different devices.The lightweight version is a version of the full application thatrequires less storage space, memory to execute, etc., can be executedwithout launching the full application, and may have a subset (e.g.,fewer than the full set) of the features and/or functions of the fullapplication. In some examples, a full game application can be installedon a different device of the first user's (e.g., a desktop or laptopcomputer) and a lightweight version of the game application can beexecuted as an embedded application on the user device. Such alightweight game application can allow the first user to provide userinput in the embedded interface to change game settings or game datarelating to the first user or the first user's account used in the fullgame application. Such changes can include managing game resources ofthe first user used in the full game application, e.g., organizinginventory of game items, buying or selling items within the game,allocating points for particular game abilities of the first user'saccount, changing preferences or display settings, perform simple gameactions, etc. Changes made by the user with the lightweight applicationare saved to the full game application, e.g., saved in the users accountat a server, and accessed by the full game application when that fullapplication is executing and can, e.g., synchronize with the server.Similarly, changes can be made with a lightweight version for a mediaitem player program, graphical editing program, word processor, or otherapplication program. In some implementations, other member users in anembedded session can share the lightweight application to adjust theirdata and settings of the full application and/or change the first user'sdata and settings, e.g., when the first user is not online. In someexamples, the lightweight version embedded application can provide ashared, second-screen experience on user devices of an application thatexecutes on different devices.

In some implementations, an embedded application can trigger initiationand execution of an external application, e.g., a different embeddedapplication or other application external to the messaging application,on the first user device or other device in communication with the firstuser device. For example, the external application can be a fullapplication corresponding to a lightweight version implemented by theembedded application, similarly as described above. In some examples,the embedded application can initiate the external application tocomplete processing a task (e.g., determine the result of a transaction,provide a rendered display bitmap, etc.). In some implementations, anembedded application can provide selectable data (e.g., words, links,buttons, etc.) to be displayed in the chat interface and chatconversation. For example, the embedded application can provide theselectable data to the messaging application, and the messagingapplication can display the selectable data in the chat interface andchat conversation. The selectable content is selectable by user input,e.g., can be clicked on via a touchscreen or other input device. Whenselected by user input, the selectable data can cause a command to besent to the operating system of the device to initiate and execute theexternal application (e.g., on the user device), where the otherapplication can be identified in or associated with the selectable data(e.g., a default application associated with a type of the selectabledata).

In further examples, when initiating the external application asdescribed above, associated data such as parameters, configurationsettings, and/or arguments can be passed to the external application topresent particular data from the external application. In sone examples,the embedded application can generate a map icon associated with aspecific address, and the icon is displayed in the chat interface. Whenthe icon is selected by user input, a map application program isinitiated and displays a map in a view that includes a selected locationof the associated address. In additional examples, an external shoppingapplication can be initiated by selection of an item description sent tothe chat interface by the embedded application, and a checkout shoppingdisplay of the external shopping application can include information ofthe user automatically filled into fields of the shopping display. Infurther examples, users select a hotel location and room using a sharedembedded reservation application, and selecting a displayed control(e.g., “reserve hotel room” button) in the chat interface or embeddedinterface opens an external full reservation application on the userdevice. The full reservation application displays a reservationinterface that is automatically filled in with the reservationinformation from the embedded application, and a user can select a “pay”button in the reservation interface to provide payment to the hotel forthe reservation.

In some implementations, the first embedded application can detect oneor more external applications that are installed on the first userdevice and modify content data that is displayed on the first userdevice by one or more of the external applications. For example, theembedded application may be a lightweight version (e.g., lightweightapplication) of a full version (external) application (fullapplication). For example, if the lightweight application on the firstuser device detects that the corresponding full application is installedon the first user device, then the lightweight application can enablespecial features (e.g., additional controls, displayed data, etc.) inthe full application by communicating with the full application, e.g.,via the messaging application. In some implementations, a complementaryrelationship can be provided between the full application and thelightweight application (embedded application). In some examples, a fullapplication can communicate data in the background (e.g., not displayedby the first user device), such that the lightweight application candirectly communicate with the full application in the background toaccess or exchange data. This communication can trigger displayed dataand options in the lightweight application and/or full application,e.g., with no need for additional authentication between the lightweightapplication and an authentication server. For example, a login processon a full reservation application can be triggered by the correspondinglightweight application using the full application account of the userregistered within the full application on the user device and notrequiring the user re-authenticate within the lightweight application toperform a reservation.

In some implementations, the output from the first embedded applicationcan include data provided to the chat interface of the first deviceand/or provided to the chat conversation, e.g., data that is displayedon the chat interfaces of chat devices participating in the chatconversation. For example, the first embedded application can providedata to the first messaging application, which outputs the data in thechat interface and/or to the other chat devices. In some examples, theembedded application can send data describing events or notifications tothe message application (and/or the message application can receive datadescribing events and notifications from other devices), and the messageapplication can display the data describing the events or notificationsin the chat conversation to improve the engagement, retention, andawareness of users about the occurrence and events within embeddedsessions. For example, output to the chat interface can be provided astext or other type of chat message (or image, video, audio, etc.). Theoutput to the chat conversation can be transmitted to all chat devicessuch that it is displayed in the chat interface of all the user devicesparticipating in the chat conversation. In some implementations, theoutput to the chat conversation can be transmitted to a subset of theparticipating chat devices to display the output. For example, theoutput can be provided in the chat conversation and visible to memberusers, or to particular chat users selected or designated by the firstuser. In some implementations, such data output to the chat interfaceand chat conversation can be shared outside of the messagingapplication, e.g., to other applications executing on the first userdevice. In some examples, such data shared outside the messagingapplication can, when selected by a user or processed by a differentapplication, cause the messaging application to open or move to theforeground on the user device, and can cause the embedded application toexecute and the user to join the embedded session.

In some examples, notifications output to the chat conversation caninclude descriptions of events occurring in the embedded session relatedto user actions, content data, events in a game, etc. provided by theembedded application in the session. For example, such notifications caninclude, “User1 and User2 are watching the party scene movie Adventurein Time,” (triggered by the scene being played), “User1 re-took the leadscore in the Toads game!” (triggered by this game event), or “User2 justreserved tickets to the Jubilee concert!” (triggered by the userreserving these items in the embedded application). In someimplementations, the notifications can include text, images, videos,audio output, cinemagraphs, or other types of content data. In someimplementations, such descriptions of events can be displayed oninteractive cards, described below, which can allow a chat user toprovide input to the notification/card to join the embedded session orprovide input to the embedded application. In additional examples, theembedded application can have access to a list of the chat users (e.g,obfuscated chat IDs) in the chat conversation and can issue invites tothe chat conversation to bring non-member chat users to join theembedded session, where, e.g., the non-member chat users can select theinvite to cause their device to join the embedded session.

In some examples, the embedded application can send chat messages to thechat conversation on behalf of the user (e.g., with user's approval, asdescribed below). In some implementations, the attribution of suchmessages can be to the embedded application and not to the user's chatidentity, e.g., the embedded application can assume a chat identity ofits own as the originator of its chat messages. Such chat messages caninclude memes, text, images, videos, or other type of content dataresulting from editing performed by the user in the embeddedapplication, web content snippets edited by a user in the embeddedapplication, etc. In some examples, the attribution or name of theembedded application, as displayed in the chat interface of other chatdevices, can be selectable by user input, and if selected, causes theembedded application to open to edit the same shared content data oredit another content data item.

The embedded interface can present displayed options to modify, setup orenable additional features to the chat conversation. For example, suchfeatures can include an auto-reply feature (selecting a random suggestedreply or auto-answering questions with prior answers from the first userto prior similar questions), censoring or replacing particular wordsbefore the words are sent to the chat conversation or received fordisplay on the first device, etc. For example, the embedded applicationcan use APIs to modify the chat conversation experience for the user.Thus, in some implementations, the embedded application provides avisual interface enabling modified settings and/or provided featureswithin the messaging application (e.g., providing messaging applicationfeatures instead of—or in addition to—providing shared content data forchat users).

In additional examples, notifications (or other data) output to the chatconversation can include messages based on chat messages input by chatusers. For example, the first embedded application can check a list ofchat messages input by a user in the chat conversation, determine usageof slang vs. proper vocabulary in the chat messages (e.g., by consultinga stored dictionary, using a machine learning model trained with slangand vocabulary, etc.), and output a rating in a notification indicatinga score for the user's writing in the chat. The embedded application candetermine and indicate in notifications, e.g., the frequency of usage ofparticular words by the user in chat messages, or a challenge to theuser to use particular words (and can verify that the user has used theparticular words in later notifications). In some implementations,notifications output to the chat conversation can include messages fromone or more member users in the embedded session to a different memberuser as an indication of events occurring in the embedded session, e.g.,invitations, challenges to other users (“beat my score,” “guess mydrawing,” “I built a tower, try to destroy it”), or boasting/whiningmessages or notifications (e.g., a player killed another player'scharacter, a player complaining that another player stole their pet,etc.).

In some additional examples, an embedded application having access tothe chat conversation message stream can provide information related tothe chat conversation, e.g., a high-level summary of the conversation, arecord or list of content data that was shared in the chat conversationby chat users, displaying (e.g., pinning) controls or other options inthe chat interface or embedded interface allowing a user to selectcollected topics, information, or shared content data from the chatconversation to save for later, to save on a favorites list of the user,etc. For example, the embedded application (e.g., a particular“summarizer” type of embedded application) can detect topics shared inthe chat conversation and provide reminders, summaries, and/or actionsrelated to those topics. In some examples, User 1 tells User 2, “don'tforget Kenny's birthday on Saturday” and the embedded application, wheninitiated, automatically adds a calendar event to the calendars of User1 and User 2 stored on their user devices, or displays a suggestedcommand or notification that causes the embedded application to add thecalendar event when the command or notification is selected by the user.In another example, User 3 inputs a message in the chat conversationthat includes an address or location of a restaurant for next week'sreunion dinner, and the embedded application auto-pins (persistentlydisplays) in the chat interface, or otherwise stores, the location as asummary so that the first user does not have to review and scrollthrough old chat messages a week later to find the location. Forexample, summaries can include descriptive and identifying information(e.g., times, locations, names, phone numbers, addresses, etc.) inputinto the chat conversation, and/or can include messages that receivedreactions from other chat users in the chat conversation (e.g., userapprovals, exclamatory messages, etc.). In another example, User 1shares images captured from the latest company trip in the chatconversation, and the embedded application automatically (with userconsent) uploads the images to a shared group photo album “Company tripto Vegas” that is shared with all the chat users (e.g., stored on aserver over the network). In some implementations, if an embeddedapplication does not have the capability to execute such actions basedon chat conversation content data, it can trigger the initiation andexecution of a different embedded application (or other application)that has that capability, and which executes the actions. In someimplementations, one or more such actions of the embedded applicationcan be presented as suggested commands and/or suggested messages whichcan be selected by the first user to implement the selected commands, asdescribed herein.

In some implementations, the notification to the chat conversation canbe provided in response to one or more particular events or particulartypes of events that have occurred on a server (e.g., server events) incommunication with the messaging application and/or embedded applicationover the network, e.g., events that have been processed in a serverapplication executing on the server. The server can send server eventinformation to one or more of the member devices such that the messagingapplication displays the server event information in the chatconversation. In some examples, this server can manage second contentdata for other network users, where the second content data is the sameor related to first content data that the server is providing to theembedded application on the first user device (e.g., media item data,game data, etc.). For example, the server may send the second contentdata over a network to one or more other users accessing the contentdata on other user devices (e.g., that are not participating in the chatconversation) via other embedded applications and/or other mechanisms(e.g., web sites, dedicated viewing applications on user devices, etc.).The server can detect whether the second content data is the same orsimilar to the first content data provided to the embedded application(e.g., same title of media item, game, etc.). Furthermore, the servercan detect user actions associated with the first content data andsecond content data, which may qualify as server events. For example,the server can detect that the second content data has received a numberof favorable user ratings from other users, e.g., over a thresholdnumber of favorable ratings. This can be predefined as a server event,causing the server to send server event information (e.g., “this moviehas received 1 million approvals!”) to the first embedded application todisplay in the embedded interface, and/or to the messaging applicationto display in the chat interface.

In some implementations, if user consent has been obtained, outputprovided from the embedded application can include input informationbased on user input received from the first user in the embeddedinterface, where the messaging application sends the input informationover the network to a server, e.g., for display at other member devices,etc. The messaging application can also or alternatively determine andsend input information to the server (if user consent has beenobtained), where the input information is based on user input that wasreceived in the chat interface outside the embedded interface. Forexample, the user input can be a chat message, user comments or ratingsassociated with a content item (e.g., media item or game) being playedin the embedded session, etc. In some implementations, these comments orratings can be received by the server and associated with the contentitem that the server provides to devices. The server can provide thecomments or ratings to user devices accessing the content item on theserver. For example, other user devices that are not participating inthe chat conversation may access that content item on the server, e.g.,via different embedded sessions or other applications. Such other userdevices can also access the comments or ratings provided by the firstuser. For example, user input such as user comments or ratings can besent to the other user devices and displayed in embedded interfaces orother application programs on the other user devices.

In some implementations, if user consent has been obtained, the inputinformation sent to the server can include information indicating theparticular content items that have been played in embedded applicationson the first device. The server can update a stored history of userselections of content items based on the input information, where thehistory is associated with the first user of the first device. Thestored history can also indicate user selections of content items storedby the server and viewed in other applications used by the first user.In some implementations, the server can use the stored history todetermine suggested content items for the user that are related (e.g.,in genre, viewings by other users, etc.) to content items previouslyaccessed on the server by the first user. In some implementations, suchserver-suggested content items can be displayed in the chat interfaceand/or by an embedded application that plays the type of the contentitems.

In addition, information generated by an embedded application, bot (seebot descriptions below), or server can be updated by the embeddedapplication, bot, or server if new conditions are triggered. In anexample, User 1 uses an embedded media player application to share avideo in an embedded session in the chat conversation. User 2 opens acorresponding embedded media player application at his or her device andcomments on or rates the video with a rating. The embedded application,bot, or server can update the shared video, and update a notificationdescribing the video that is displayed in the chat conversation toreflect and propagate the new information to the chat users (e.g.,display an indication that the video now has +1 user approvals, +1 usercomments). In some implementations, updatable “interactive cards” aboutan embedded session are shared in the chat conversations, which can becontrolled by a server, bot or embedded application.

In some implementations, when output data from the first embeddedapplication is to be output to the chat conversation and/or to a serverfor display, a prompt is displayed (e.g., with a user-selectable option)to allow the first user to select whether to allow the data to be outputin the chat conversation or not. For example, the prompt can display themessage that is to be sent to the chat conversation or server ifapproved by the user. In some implementations, the prompt can bedisplayed for particular types of output data to the chat conversation(e.g., particular types of messages, having predefined keywords,indicating events of particular types, output data that is a response toa particular type of action or command provided by a member user to theembedded application, etc.) and not displayed for other types. Theprompt can be displayed for particular types of embedded applications,and not displayed for other types. In some implementations, the firstuser may have stored accessible user preferences that are accessed todetermine the conditions under which a prompt is to be displayed. Forexample, user preferences can indicate that the prompt should ask foruser consent to send output from a game types of embedded applicationsto the chat conversation, and not provide the prompt for a media playertypes of applications or other types of applications.

Output can also include data transmitted to corresponding embeddedapplications executing on other member devices over the network, e.g.,via an associated messaging application and/or a server system. Forexample, the transmitted data can include user input (or data derivedtherefrom) received by the first embedded application from the firstuser, e.g., selecting elements or changing states in the first embeddedapplication. The transmitted data can include event informationindicating one or more events occurring in the first embeddedapplication (e.g., based on user input from the first user, programevents based on execution of code and particular conditions, or otherevents occurring local to the first embedded application), similarly asdescribed above. The data can be provided to the first messagingapplication, which can transmit the data (or a processed form of thedata) over the network to other devices. For example, the data can besent to a message router, e.g., a session server as described above,which can send the data to other member devices, and/or the data can besent directly to one or more member devices. The other member devicescan receive and use the user input and/or event information to updatethe states of the corresponding embedded applications to synchronizewith the first embedded application.

In some examples, the output from the embedded application can includeevent data that indicates one or more particular events (or types ofevents) that have occurred in the embedded session. The event data canbe provided from the embedded application to the messaging application,which can generate a notification based on the event data and causes thenotification to be displayed in the chat interface and sent over thenetwork to be displayed in the chat conversation (e.g., chat interfaces)for member devices and/or chat devices. For example, the events may haveoccurred in the first embedded application. In various examples, theevents in the embedded session may have occurred in response to thefirst user input from the first user and other user input received fromthe one or more member users of the embedded session. In some examples,types of events may be changing a playback position of a media item, oran initiation or ceasing of playback of a media item in an embeddedmedia player application; achieving an objective, ending a game or aparticular phase or portion of game duration, or other game event in agame provided by an embedded game application; modifying a contentdocument (e.g., an item in a shared list) in an embedded listapplication; reserving a seat via an embedded reservation application;etc. In some implementations, the events in the embedded session mayhave occurred on a server managing the embedded session (e.g., a sessionserver), which provides the event data to the messaging application,which can generate a notification for display in the chat conversation.Types of events on such a server may include reception of input data atthe server over the network from other users external to the chatconversation, availability of a new content item related to a contentitem playing in the embedded session (e.g., the new media item has thesame artist, author, actors, production company, genre, etc. as theplaying media item, or the new content item is known to be on afavorites list of one or more member users, if they have providedconsent), a disconnection of one or more member users from the server,etc.

In some examples, the embedded application can output controlinformation (e.g., via the messaging application) to an externalapplication executing (or initiated) on the first user device orexecuting on a different device in communication with the first userdevice over the network. In some examples, the embedded application canoutput control information to applications that control home appliances,vehicle functions (lock/unlock doors, change thermostat, etc.), or othertypes of devices. For example, such control information can be output inresponse to selection of displayed controls in the embedded interface(e.g., buttons, dials, etc.), or automatically in response to chatmessages input by the first user (e.g., “open my front door”, causingoutput of control information to unlock the door of the user's house) orbased on chat messages in the chat conversation input by chat users(e.g., messages discussing going into a car, causing the embeddedapplication to send control signals to unlock doors of that car). Inanother example, the embedded application can send application data toaffect game states of a console/desktop game in response to receivinginput from the first user and/or other chat users in the embeddedinterface or in the chat conversation. For example, the chat users mayselect controls in the embedded interface to send data to a server,where the data is read by a game application on a different game deviceto change game resources (as described above), or start a game on thegame device, perform game actions in the game, etc. In another example,the embedded application can automatically send information to the gamethat causes game characters of the chat users to be formed into a groupin the game based on chat messages from the chat users in the chatconversation (e.g., “let's join up in the game”). The chat conversationprovided on the chat devices can act as a chat interface between playersof the game executing on the game device. In some implementations,control information can be presented in the chat interface as suggestedcommands for the external application, as described below, which can besent to the external application in response to selection by user input.

In additional examples, the embedded application can provide data to themessaging application to permanently or temporarily modify a visualrepresentation of the first user in the chat conversation. For example,a user status or role can be displayed next to every message or username (e.g., “User1—player”) or a title bestowed by the embeddedapplication (e.g., “User1—the Conqueror” for a game). In additionalexamples, a filter can be applied to modify a user profile imageappearing in the chat interface and/or modify chat messages input by thefirst user (e.g., highlighted with colors, borders, frames, stickers,etc.). Such modifications can be provided while the first user isparticipating in the embedded session and/or as rewards for achievementswithin the embedded application. Rewards can include unlocking otherembedded applications for use by all chat users. The integration betweenthe messaging application and the embedded application via exposed APIscan allow such features.

Some embedded applications can change a displayed keyboard layout,displayed buttons, or other displayed controls in the chat interface (orcontrols provided by the operating system or other interface displayedby the user device) based on the type of embedded application and/or inresponse to events in the embedded application or chat conversation. Forexample, a layout of a keyboard displayed in the chat interface can bechanged to match a game controller specialized for a particular embeddedgame application. In another example, events such as achieving anobjective in a game, or being defeated in a game, can cause one or moredisplayed buttons to be added to or removed from the chat interface inaccordance with increased or decreased options in the game for the user.In another example, when a user in inputting a text query to perform asearch for an item (e.g., a product), as more characters are input, theembedded application can cause additional suggested characters for thequery that do not match any search results to be removed from display,or displayed with lower visibility than matching characters (e.g.,grayed out).

In additional examples, embedded applications of various types canexecute in association with the messaging application. For example, anembedded media player application can receive user input from memberusers in an associated embedded interface and/or chat interface. Theinput can select playback functions of media items such as videos,images, audio data, documents, etc., and output from the embeddedapplication can provide playback of the media item. An embedded gameapplication can receive user input from member users which can changegame states, and output of the application can include visual, auditory,and tactile output indicating a game environment and game states. Anembedded shared document application can receive user input from membersusers which can change a shared content document (e.g., list or otherdocument) and output of the embedded application can display the updatedcontent document. An embedded travel itinerary application can receiveuser input from members users which can select travel destinations,routes, times, and other travel-related preferences, and the output ofthe embedded application can include display of available travel routes,options to select particular routes, times, and method of travel withuser input, etc. An embedded reservation application can displayselectable options allowing member users to reserve places or attendanceat hotels, restaurants, movies, conventions, rides, parks, entertainmentperformances, and other future events. For example, such an embeddedapplication can receive user input from member users that specifiestimes, places, and events at which to reserve places (e.g., includinguser selections of seats, tables, or other places in a graphicaldisplay), and the embedded application can output suggested events anddates/times, indications of reservations being successfully made ordenied, etc. In some implementations, various types of embeddedapplications (e.g., having different functions or purposes) can becombined into a single embedded application.

In block 222, it is determined whether the first messaging applicationhas been exited at the first device. For example, user input received bythe first device may close the messaging application. If the firstembedded application has been exited, then in block 224, the chatinterface is removed from the display of the first device, includingremoval of the embedded interface. In some implementations, the embeddedapplication is also removed from memory of the first device. Inaddition, information can be sent to a device managing the embeddedsession, e.g., the session server, to indicate that the first device hasexited the embedded session. In some implementations, the managingdevice (e.g., session server) updates the session user list to removethe first user and provides this update to other member devices of theembedded session.

If the messaging application has not been exited, then in block 226 itis checked whether the first embedded application has been closed at thefirst device. For example, user input can be received at the firstdevice from the first user that selects a displayed element in the chatinterface or embedded interface to close the embedded application. Ifthe first embedded application has been closed, then in block 228 theembedded interface is removed from the display of the first device. Insome examples, the removal of the embedded interface allows the chatinterface to occupy the area formerly occupied by the embeddedinterface. In addition, information can be sent to a device managing theembedded session (e.g., session server) to indicate that the firstdevice has exited the embedded session, similarly as described for block224.

In block 230, in some implementations, an indication is displayed in thechat interface indicating that the embedded application is in use by oneor more other member devices, if such a condition exists. For example,the indication can be an icon or other element displayed in the chatinterface while the embedded application is continued to be used in theembedded session that was exited by the first user. In someimplementations, the indication can be selected by user input to causethe first user and first device to re-join the embedded session of theembedded application, e.g., re-execute the embedded application fromcode stored in memory of the first device and/or download and executethe embedded application. Some implementations can remove the displayedindication if all users have exited the embedded application, and/or ifno member users have interacted with (e.g., provided input to) theembedded session or embedded applications after a threshold period oftime.

In some implementations, multiple embedded applications can be executingsimultaneously and multiple embedded interfaces can be displayed by thefirst user device in association with the chat interface (e.g.,similarly as for the embedded interface as described above). In someexamples, multiple embedded applications can execute simultaneously onthe first user device. In some implementations, the multiple embeddedapplications can communicate data to each other. For example, oneembedded application can send a command to the other embeddedapplication to cause the other embedded application to update one ormore states, remove or add a member user, etc.

In some implementations, the messaging application can manage aconversation “currency.” This can be a virtual currency that can begenerated by embedded applications, earned by chat users, and exchangedwith other chat users within the embedded applications and/or within themessaging application. In some examples, a user can receive tokens or“coins” when performing particular tasks or goals in embeddedapplications, e.g., completing an objective in a game, editing a videoor image for a threshold amount of time or threshold number of editoperations, playing a media item for a threshold amount of time, editinga shared list, completing a travel reservation, etc. In variousimplementations, the currency can be spent by a user to obtain rewards,e.g., the ability to change visual features of the chat interface,select new options, or use other features of the chat interface. Inadditional examples, the currency can be spent to enable use of (e.g.,unlock access to) visual text characters, icons, or images that can beinserted into chat conversations (e.g., “sticker packs”), use ofparticular conversation features (e.g., change message text fonts, addcolors or titles to chat identities, use a particular image or avatar inthe chat conversation, etc.), use of particular embedded applications,etc. In some implementations, the currency can be used to unlock orimprove features in embedded applications (e.g., use of particularavatars or characters in games, access to particular media items with amonetary discount, use of different displayed appearances for embeddedinterfaces, etc.). In another example, a user can send a particularamount of the currency to a different chat user, or can transfer (orcopy) obtained rewards or access rights to a different chat user inexchange for an amount of the currency. In some implementations, thecurrency can be converted to a real currency, allowing forperson-to-person payments (e.g., splitting a bill at a restaurant, orsmall debt settling).

FIG. 3 is a flow diagram illustrating an example method 300 to enable auser to join an embedded session, according to some implementations. Insome examples, method 300 can be included in block 218 of FIG. 2. Insome implementations, method 300 can be implemented, for example, on aserver system, e.g., messaging server 101, as shown in FIG. 1. In someimplementations, some or all of the method 300 can be implemented on asystem such as one or more client devices 115 as shown in FIG. 1, and/oron both a server system and one or more client systems. In describedexamples, the implementing system includes one or more processors orprocessing circuitry, and one or more storage devices such as a databaseor other accessible storage. In some implementations, differentcomponents of one or more servers and/or clients can perform differentblocks or other parts of the method 300.

In some implementations, method 300 can be implemented on a differentuser device than the method 200 of FIG. 2, e.g., a second user device.For example, the second device can communicate with the first device ofFIG. 2 over a network. The second device is participating in a chatconversation, and the embedded session has been initiated by a chat userof a different device participating the chat conversation. In theexample of FIG. 3, the embedded session was initiated in associationwith the first embedded application of the first device as describedwith reference to FIG. 2, and the second device is participating in thesame chat conversation in which the first user and first device areparticipating.

In block 302, it is checked whether user consent (e.g., user permission)has been obtained to use user data in the implementation of method 300.For example, user data can include messages sent or received by a user,e.g., using messaging application 103, user preferences, user biometricinformation, user characteristics (identity, name, age, gender,profession, etc.), information about a user's social network andcontacts, social and other types of actions and activities, content,ratings, and opinions created or submitted by a user, a user's currentlocation, historical user data, images generated, received, and/oraccessed by a user, videos viewed or shared by a user, etc. One or moreblocks of the methods described herein may use such user data in someimplementations.

If user consent has been obtained from the relevant users for which userdata may be used in the method 300, then in block 304, it is determinedthat the blocks of the methods herein can be implemented with possibleuse of user data as described for those blocks, and the method continuesto block 308. If user consent has not been obtained, it is determined inblock 306 that blocks are to be implemented without use of user data,and the method continues to block 308. In some implementations, if userconsent has not been obtained, blocks are to be implemented without useof user data and with synthetic data and/or generic orpublicly-accessible and publicly-usable data.

In block 308, an indication (e.g., notification) is received at a secondmessaging application of a second device that an embedded session for anembedded application is active. In some examples, the indication can bedata indicating the particular embedded application that has beeninitiated and indicating that an associated embedded session has beeninitiated. In some implementations, the indication can include anidentification of the chat user from the chat conversation thatinitiated the embedded session. In some implementations, the data of theindication may have been sent by a session server, e.g., after theembedded session was initiated.

In some implementations, identifications (e.g., user IDs) of the chatusers who are currently members of the embedded session (e.g., who havejoined the embedded session) are included in the received indication.For example, the list of session users described with reference to FIG.1 can be provided in the indication. Alternatively, the current numberof member users can be indicated without the identifications of themember users. In some implementations, the received indication caninclude additional information. For example, the information can includethe amount of time since the embedded session was initiated, one or morecurrent states of the embedded application(s) in the embedded session,and/or other information related to the embedded session. In someexamples, the additional information can include the name of mediaitem(s) currently being played, in queue to be played, or otherwisebeing processed for the embedded session, the current number of items ofa shared list (or other shared document data) being edited in theembedded session, statuses of one or more of the member users withregard to the embedded session (e.g., identifying users as controllers,players, observers, etc., and/or identifying a user who is currentlyediting a document or winning a game implemented in the embeddedsession, etc.), a list of objectives so far achieved in the embeddedsession (e.g., finished playing a video, game objectives completed, alist is finalized, etc.), a specific request from one or more currentmember users of the session for additional user members to join theembedded session, etc. In some implementations, the additionalinformation can include messages from one or more member users in theembedded session to the second user, or to other member users as anindication of events occurring in the embedded session, e.g.,invitations, challenges to other users (“beat my score,” “guess mydrawing,” “built a tower try to destroy it”), boasting or whiningnotifications (e.g., a player killed another player's character, aplayer complaining that another player stole their pet, etc.). In someimplementations, updates to this information can be received by thesecond device at later times, e.g., updates to the current number ofmember users, a current state of the embedded application, etc.

In block 310, the second messaging application causes display (or othertype of presentation or output) of a notification and a join option bythe second device. The notification can include one or more items ofinformation that were received in block 308, e.g., descriptiveinformation about the active embedded session indicated in block 308.For example, such items of information can include the name oridentifier of the embedded application used in the embedded session,content data being shared (e.g., media item played, content documentedited, etc.), current member users who have joined the embeddedsession, statuses of one or more of the member users with regard to theembedded session, current state(s) of a participating embeddedapplication, messages from member users, and/or other informationreceived in the indication of block 308. In additional examples,information in the notification can refer to content data or states ofthe embedded application (playback position of media item, high scoresin a game, game state information) or content data of the chatconversation (as allowed by user privacy controls). Further,notification information can include embedded application download sizeand application description, indication that user permission isrequested for use of user data and the types of data (e.g., user data)the embedded application will access, a list of users that have alreadyjoined the embedded session, etc. In some implementations, the displayednotification can take the form of an “interactive card” as describedherein.

The join option is a selectable option that, if selected by user input,allows the second user to join the active embedded session. In someimplementations, the join option can be an interface element displayedin the chat interface of the messaging application where data of thechat conversation is being displayed. For example, the join option canbe displayed as a selectable control (e.g., button) in the notificationdisplayed in the chat interface.

In some implementations, the join option can be displayed, or can behighlighted (e.g., displayed in a bright color, flashing, etc.) orotherwise emphasized in the display, if one or more conditions are met.For example, the conditions can be specified in stored user preferencesof the second user. Such conditions can include, e.g., the embeddedsession is a specified type or is associated with a specified embeddedapplication, one or more specified users are currently member users ofthe session, a specified user status (e.g., user role) is stillavailable for the second user in the embedded session (e.g., not yetassigned to other member users), the embedded session has not beenactive for more than a specified period of time (e.g., the time periodafter initiation of the embedded application by the first user of FIG.2), the output of a sequential media item being played in the embeddedsession (e.g., video or audio data) has not yet progressed past aspecified percentage of the total playing time, or other conditions.

In some implementations, the join option can include one or moredisplayed additional options in addition to join the embedded session(e.g., displayed user interface elements corresponding to the additionaloptions). For example, the additional options can include an option toselect a command or request for one or more particular user statuses(e.g., user roles) that the second user can or is to be assigned in theembedded session. The user statuses or roles can be selected by thesecond user from a set of predefined user statuses or roles. A userstatus can define one or more functions of the embedded application ableto be activated by the user participating in the embedded session and/orcan define the capability of the user to modify data and/or states ofthe embedded application and embedded session. Examples of user statusesor roles can include a controller (e.g., a user able to modify data suchas a content document (e.g., list), or control playback of a mediaitem), a player in a game (e.g., able to be winner or loser in thegame), an observer of application events (e.g., view displayed playbackof a media item or playing of a game and not able to affect media itemplayback or input game actions), a referee in a game (e.g., adjudicatingrules of the game, initiating next rounds of play in the game, etc.), anadministrator (e.g., initiating and stopping embedded application outputor processing such as media item playback or games, assigning ordividing resources to players in a game, etc.), a leader of a team ofmultiple users in a game, a user status or role allowing the user tomodify operation of the embedded application (e.g., designate rules orconditions of a game, control playback of media data, or other output),etc. Some user statuses or roles can be restricted or limited, e.g.,only qualifying users can be assigned these roles (e.g., a maximumnumber of players in a game may restrict additional users from beingassigned a player role if the maximum number has been reached), whileother statuses or roles can be unlimited (e.g., observers of a game). Insome implementation, a join option can include a request for permissionfrom the user for the embedded application to use particular types ofuser data associated with the second user.

In block 312, user input is received by the second device and the secondmessaging application, the user input instructing that the second userand second device join the embedded session. For example, the user inputcan be selective user input that selects a displayed join option (asdescribed for block 310) via a touchscreen or other input device, inputa text or menu command, etc. In some implementations, the second userand second device can join the embedded session without explicitlyreceiving user input instructing to do so. For example, one or moreconditions can be specified in stored user preferences of the seconduser that may instruct to automatically join an embedded session if oneor more of the conditions are met. For example, the conditions caninclude one or more conditions as described above for block 310.

In some implementations, user input can be received by the secondmessaging application which specifies additional input related to thejoining of the second user to the embedded session. For example, theuser input can select a status of the second user in the embeddedsession. In some examples, the user input can select or specify a userstatus (e.g., role) in the embedded session to be assigned to (orrequested by) the second user, as described above. In otherimplementations, the user status or role can be selected by the seconduser, by the second embedded application, or by the session server afterjoining the embedded session. In some implementations, the user inputcan include other designations or selections, such as a time at whichthe user wishes to exit the embedded session, a selection of an icon,avatar, image, or other data to be associated with the user while beinga member of the embedded session, etc. In some implementations, the userstatus or other designations can be selected, by user input, from a menuor other list of options displayed in the chat interface.

In some implementations, the second user and/or one or more other chatusers can be automatically joined to an active embedded session, or canbe automatically provided a customized option (e.g., in block 310) tojoin an active embedded session. In some examples, such chat users mayhave been detected to be interested in the embedded application based ontheir input messages in the chat conversation. In an example, three chatusers input chat messages to the chat conversation describing a vacationto a particular geographic location (e.g., Hawaii). One of the chatusers issues a command in a chat interface to start an embedded travelitinerary application, and the other two users are automatically joinedto the associated embedded session, or are provided a notification thatindicates that the embedded session relates to their discussed traveldestination (e.g., Hawaii), based on the messaging application or otherdevice application parsing the messages input by these users in the chatconversation (e.g., parsing the location name, etc.).

In block 314, a second embedded application is downloaded and/orexecuted for the second device, in response to the user input to jointhe active embedded session of block 312, and the embedded session isnotified of the joining event. For example, the second device can send arequest to and download the second embedded application from a serversystem hosting embedded applications similarly as described for FIG. 1.The download of the second embedded application can occur in thebackground of the operating environment of the first device, e.g.,similarly as described above. After (and/or during) the second embeddedapplication is downloaded, it can be executed on the second device. Insome implementations, one or more parts or components of the secondembedded application can be executed by one or more other devices incommunication with the second device, e.g., one or more server systems.In some implementations, the second embedded application corresponds tothe first embedded application and to embedded applications executed onother member devices of the embedded session. For example, the secondembedded application can include the same code (or substantially thesame code) as the first embedded application of FIG. 1.

The second messaging application can send notification information tothe embedded session indicating that the second user has selected tojoin the embedded session. For example, the notification information canbe sent to the session server, which conveys the joining event to theother member devices (including the first device) by sending thenotification information (or information derived therefrom) to thosemember devices. In some implementations, the session server can updatethe session user list for the embedded session stored by the sessionserver, e.g., add the second user to its session user list. Someimplementations can send the notification information directly to one ormore other member devices of the embedded session. In someimplementations, the second device sends a request to join the embeddedsession, and a session server (or embedded device) can send back aresponse to the second device that causes the second device to connectto the embedded session (and/or initiate the execution of secondembedded application on the second device, if it is not alreadyexecuting).

In block 316, the second messaging application provides user informationto the second embedded application on the second device. In someimplementations, the second embedded application can request such userinformation. For example, the user information can include a memberupdate, e.g., an update of the members in the embedded session. In someexamples, the user information can include user identities of the memberusers of the embedded session, which, for example, can be the chatidentities of the users and user devices participating in the chatconversation. In this example, the chat identity of the first user canbe provided, and chat identities of any other member users. The secondmessaging application can provide the user identities, e.g., where thesecond messaging application received the user identities in block 308and/or has previously received from a messaging server for the chatconversation implemented by the second messaging application.

In some implementations, the user information for a particular user(e.g., the first user) can be provided by the second messagingapplication to the second embedded application if the second messagingapplication has obtained consent from the second user to do so. Forexample, such consent can be included in user information provided forthe chat conversation, in some implementations. If no consent from theuser has been obtained, then the user information is not provided to thesecond embedded application.

In some implementations, the second messaging application can, prior toproviding the user identity to the second embedded application,anonymize the user information (e.g., anonymize or obfuscate one or moreuser identities) so that the user information does not describe theparticular user nor can be associated with the particular user (or onlypartially describes or is associated with the particular user). In someexamples, if a chat identity is a user name, a “dummy” or “temporary”name may be assigned for use by the embedded application and in theembedded session. For example, the first user chat identity can bechanged to a generic identifier or name such as “User 1,” “Friend 1”,the initials of the first user, the first name of the first user, etc.For example, a name such as “John Doe” may be replaced with a temporarypseudonym (e.g. “Kenny”). The anonymized user information can beprovided to the second embedded application as one or more useridentities.

In some implementations, the second messaging application also providesadditional user information, e.g., a user status or role to be assignedto the second user in the embedded session. In some implementations orcases, this status or role may have selected by the second user, e.g.,in the embedded interface or chat interface. The second embeddedapplication can update its output based on the added second user. Forexample, the user identity of the second user can be added to a userlist displayed in the embedded interface.

In some implementations, the user status or role is determined by themessaging application (or embedded application) based on chat messagesprovided by the second user in the chat conversation (and, e.g., thisuser status or role need not be selected by the second user). Forexample, if the second user has previously input a chat message saying,“I want to play the white side” in the chat conversation about startingan embedded chess game application, then the messaging application candetect this message, determine its meaning (e.g., via comparisons tokeywords or key phrases and/or using machine learning techniques) andautomatically assign the second user to a user role of the white piecesplayer after the second user joins the embedded chess game session. Themessaging application can provide this user status to the embeddedapplication to assign the second user control of the white pieces in thegame.

In some implementations, a particular user role in the embedded sessionmay not be available to a member user (e.g., the second user) beingadded to the embedded session. For example, the user information mayindicate that the second user has selected to be a player role in anembedded game application, where such a player role allows a user toaffect game states in the game (e.g., input game actions to affect gamestate). If the number of player roles in the application is limited(e.g., a chess game application limited to two players), there may notbe a player role slot available to the second user if, for example, thesecond user is joining an active embedded session in which other memberusers have previously joined the embedded session and occupied all theavailable player roles. If such unavailability occurs, then the secondembedded application can determine a different user status (e.g., playerrole) for the second user and can inform the messaging application ofthe different user status. For example, the second user can be assignedan observer role, in which the second user is not enabled to inputactions to change particular states of the embedded application orsession. In some examples, an observer player for the embedded gameapplication can be allowed to display game states on their device butnot affect game states with user input. An observer role for a mediaplayer or shared content document can be allowed to view a media item orlist but not affect media playback or list items.

In some implementations, if the second user's selected role isunavailable, the second user can be provided with a menu of availablerole(s) in the embedded session, and the second user can provide userinput to select one or more of the available roles. In someimplementations, if a user role becomes available during an embeddedsession (e.g., a member user exits the embedded session or changes roleswithin an embedded session, such as changing from player to observer),then member users who were not assigned requested user roles can beoffered such a newly-available user role. In some implementations, aparticular user role may be removed or changed during an embeddedsession as determined by an embedded application. For example, a playerrole may change to an observer role after a game concludes or after aparticular round or phase of the game is over. User roles may also bechanged or reassigned during an embedded session by member users havingthe ability or authorization to perform such changes in an embeddedsession. In some implementations, one or more of the various changes ofuser roles during an embedded session can be indicated in data providedto the messaging application by the embedded application, and thesechanges can be indicated by the messaging application in the chatconversation of the chat interface (e.g., output as text descriptions bydevices of all chat users, or only of member users).

In some implementations, an indication that the second user has beenassigned the different (newly-assigned) user status, indications ofremoval or additions of user statuses or roles to the embedded session,and/or indications of any other change in user statuses for member usersin the embedded session, are output to the chat interface to bedisplayed on the chat devices participating in the chat conversation, oralternatively displayed on the member devices of member users of theembedded session.

In an example, the first user initiates an embedded chess gameapplication and the first and second users agree via chat messages inputin the chat conversation that the second user will start the game as theplayer controlling the white pieces. The messaging application parsesthe chat messages to determine that the first user is assigned a playerrole to play black pieces, and provides this user status to the embeddedchess application to start a game with the white pieces controlled bythe second user. A third user (another member user) then joins theembedded chess session, and the messaging application (or the embeddedchess application) automatically assigns a user role of observer to thethird user for the embedded session, since there are only two playerroles provided for the game session and those roles are occupied by thefirst and second users.

In some implementations, the user information can include otherinformation related to the member users of the session, if user consenthas been provided by participating users. For example, geographiclocations of the devices used by the member users can be obtained by thesecond messaging application, e.g., from the chat conversation, if thechat users (including the member users) have provided consent to obtainsuch geographical information (e.g., geographical coordinates, labels ofgeographic regions or areas, etc. as determined by GPS or other locationsensors of the member devices). In an example using the embedded travelitinerary application described above for three chat users, themessaging application can specify to the embedded application that thetravel context is “vacation in Hawaii mid-June” based on the users' chatmessages, and specify the respective geographic locations of the threechat user devices so that the embedded application can determine travelitineraries (e.g., travel routes, airplane flights, scheduled visits,etc.) to the destination location based on the users' device locations.In some implementations, location information can specify a location asan associated category such as “home” or “work” for a user. In someimplementations, the user information can include a local time (based onlocal time zone) of each member user. For example, the local times canbe similarly used by an embedded travel itinerary application todetermine a travel itinerary for each user. In some examples, theembedded application can use location and/or time information of memberusers to determine output information displayed in the embeddedinterface, e.g., travel itineraries, reservations at events, writtenlanguage of text output (e.g., subtitles, messages, etc.), regionalcustomizations in output, notifications based on time, etc. In variousexamples, access to member users' locations (with user consent) canenable embedded applications to use shared locations to provide output,e.g., as status updates of member user locations to a group of memberusers that are waiting for other member users at a restaurant, toprovide user locations in races and fitness challenges, and/or toprovide locations of children users for viewing by parent user who areparents of those children users.

In some implementations, the user information can include current oravailable data bandwidths over the network of one or more of the memberdevices used by member users, e.g., bandwidth, lag, or other networkconnection characteristics of each member device to a session serverimplementing the embedded session and/or to one or more member devicesimplementing the embedded session. In some examples, the embeddedapplication can use the bandwidth information to cause a modification oftransmission of input data received at the first user device and thefirst embedded application over the network. For example, the modifiedtransmission can include a different amount of data to be transmittedover the network to the first user device, causing a different rate ofdata transfer over the network to the first user device, and/or causingcompression of the transmitted data from other devices to the first userdevice (e.g., a content data stream from a content server). In someexamples, bandwidth information can be used by the embedded applicationto assign particular user statuses (e.g., roles) to particular memberusers in the embedded session. For example, high bandwidth (e.g., over athreshold) may be suited to roles requiring sending data from the userdevice to other devices, e.g., particular player users in a real-timegame, while lower bandwidth may be more appropriate for observer playersin particular game applications.

Other user information provided to the second embedded application caninclude other information if consent by the associated chat users foraccess and use of such data has been obtained, including social networkinformation (e.g., posts, ratings, comments, etc. posted to a socialnetworking service), history of the use of the embedded application bythe member users (e.g., particular media items previously viewed in theembedded application, games previously played by member users and theroles assigned to member users in those games, the win/loss record ofmember users in previous games, dates and times of previous embeddedapplication use, etc.).

In block 318, syncing information can be received at the second device(e.g., from the session server and/or other member devices such as thefirst device) and the second embedded application is synchronized withthe embedded session. In some implementations, the syncing informationcan be received in block 308 with the indication of the embeddedsession. For example, the syncing information can include one or morestates of corresponding embedded applications executing on memberdevices of the embedded session, reference time information from asession server, etc. In some implementations, the syncing informationcan be received from the session server or other device that can providethe syncing information to all the member devices of the embeddedsession to enable the embedded applications to be synchronized with eachother. In some examples, the session server receives updates of theembedded applications of the member devices based on user input (e.g.,user playback commands of media items, game actions, modification ofshared content documents, itineraries, etc.) or application events(e.g., a timer expiring, a new media item in a queue starting to beplayed, a game event occurring, etc.) at those member devices, and sendssyncing information to the other member devices. In someimplementations, the member devices can update a global synchronizingvalue or timer stored on an accessible device such as a server tomaintain synchronization with each other, an example of which isdescribed with reference to FIG. 5.

In some examples, the syncing information can include the time point (orchange in time point) of a video or audio data segment that is currentlybeing played in the embedded session, a change in state of a game playedin the embedded session, an update to a shared content document in theembedded session, etc. In another example, the syncing information caninclude clock information for other member devices that can be used forsynchronization of timed events in the embedded session. For example,spawning of enemies or treasures in a game may be synchronized acrossall member devices at a particular time, or registering the member userinputs at (or relative to) a particular time to cause an effect in agame. Registering the synchronized times at which states occur or changein the embedded session may allow accurate replaying of a recordedversion of the embedded session at a later time by a different memberuser. Precisely timing events among the member devices also allows forcompetition between users (e.g., to determine which member user is thefirst player in a game to collect or select a specific item in the gameenvironment).

In some implementations, a leader device can be elected among the memberdevices (e.g., randomly, or based on network characteristics, e.g., thedevice having the lowest latency to a server handling synchronization ofthe user devices, etc.) to allow synchronization of real-time events andoutput among embedded applications in an embedded session. For example,the leader device can be the authority for validating and propagatingstate changes to the other member devices, e.g., instead ofusing aserver system for such tasks. If the leader device goes offline, theonline member devices elect a new leader device, and when the formerleader device comes back online, it will be considered a regular(non-leader) device since its leader status was revoked. Such a leaderdevice configuration can allow multi-device shared experiences over anetwork without the use of server-side synchronization and authority.

In block 320, the embedded interface of the second embedded applicationis caused to be displayed by the second device. For example, theembedded interface can be displayed in association with the chatinterface of the second messaging application similarly as describedabove. The embedded interface is a user interface to the second embeddedapplication and allows output from the second embedded application bedisplayed by the second device (e.g., in an embedded view of theembedded interface) and allows user input to be input in the embeddedinterface to be provided to the second embedded application.

The embedded interface displays output from the second embeddedapplication that is synchronized with the other embedded applications ofthe member devices in the embedded session. For example, if a media itemis being played in the embedded session, then a media item being playedby the corresponding embedded applications on other member devices isalso played by the second embedded application, synchronized with themember devices. Thus, if the second user has joined an embedded sessionin which a media item has previously been playing for some time and iscurrently halfway through its duration, the second embedded applicationplays the media item starting at the halfway point. For example, thissynchronization can provide to the second user an experience of sharingmedia items and other output of an embedded application with othermember users.

In an example using an embedded travel itinerary application, theembedded application can provide an embedded interface that displaysinformation about airplane flights departing from the geographiclocations of the member users' devices to the travel destination forspecified dates. In some implementations, customized airplane flightinformation can be displayed in the embedded interface for each memberuser, where each embedded interface shows only the airplane flightinformation for the location of the user viewing the information in theembedded interface.

In block 322, an indication is sent over the network that the seconduser has joined the embedded session. For example, the second messagingapplication can send the indication of a join event to a session server,and the session server can send the indication of the join event tomember devices (and not to chat devices that are not member devices).For example, the session server can send the indication to the firstdevice, as described below with respect to FIG. 4. In someimplementations, the second messaging application can send theindication directly to member devices.

During the embedded session, the second device can receive user inputfrom the second user to the embedded application via the embeddedinterface and/or to the messaging application via the chat interface asdescribed herein. Input can also be received from the other memberdevices, e.g., via a session server, and/or from one or more servers(e.g., synchronization and other updates to the embedded applicationfrom the session server, content data from a content server, etc.).Output can be displayed in the embedded interface and/or in the chatinterface.

If the second user has been assigned a user status (e.g., role) withinthe embedded application and embedded session, then the second user canbe enabled by the embedded application to activate one or more functionsof the embedded application that are associated with the assigned userstatus. For example, in an embedded game application, a user assigned aplayer role can be enabled to perform game actions with user input toaffect the state(s) of the game. A user assigned an observer role can beenabled to provide input to perform view functions in the game, e.g.,cause display of different player scores, attributes, etc. with userinput, but not affect the game states. A user assigned an administratorrole or referee role can be enabled to initiate a game, assign playerusers to different teams, adjudicate a game, etc., but not affect gamestates. In some implementations, a member user can be assigned a role ofa passive observer or an active observer. For example, an activeobserver status may allow a user to modify states in the embeddedapplication (e.g., game states, playback position of a media item,etc.), or modify some types of states (e.g., guide certain types of gameobjects, add comments but not change playback position, etc.), while apassive observer may be prevented from modifying any such states. Insome examples, a single-player game may allow the first user to be themain character moving through a game environment, facing obstacles, etc.The other member users can be assigned passive observer roles bydefault, or one or more passive observer users could select to beassigned active observer roles allowing them to affect game states,e.g., instruct enemies in the game to attack or assist the firstplayer's character, directly assist the first player's character, tap onthe first player's character to slow it down, etc.

In additional examples, a particular graphical interface for theembedded interface can be displayed on a member device based on a rolethat has been assigned to the user of that member device, while othermember devices of the embedded session may display other graphicalinterfaces based on different roles (or lack of roles) of their memberusers. For example, different controls and functions can be displayed indifferent graphical interfaces for different roles. In some examples,only particular roles can have access to certain features of theembedded application. In an example of an embedded reservationapplication (e.g., similarly as described above), the first userinitiates the embedded reservation application and thus has a “reserver”status allowing that user to finalize the reservation (e.g., pay areservation fee to reserve a hotel room). The first user selectsreservation information such as a destination and itinerary, and theembedded application shares the selected reservation information withthe rest of the member devices (e.g., including the second user'sdevice) for display in their embedded interfaces of the embeddedreservation application. The second user assists the first user select ahotel room to reserve by selecting or changing reservation information(which is synchronized on all member devices). In this example, only thefirst user device of the member devices displays a “pay” button in itsembedded interface, because the first user set up the embeddedapplication/session and has reserver status. When the pay button isselected by user input, data is caused to be sent to a server tofinalize the reservation.

In various implementations, “interactive cards” can be displayed in thechat interface of chat devices of the chat conversation, such as thesecond user device. An interactive card can be a displayed informationarea or window that displays information and controls (user inputoptions) related to events, output data (e.g., content data), and inputfrom members users provided in an embedded session of the chatconversation. The information can include text, images, videos, audiooutput, cinemagraphs, or other types of content data (e.g., captured andstored images of the output displayed in the embedded interface). Insome implementations, the interactive card can be displayed in the chatinterface of the chat devices, regardless of whether or not a chatdevice is a member device of the embedded session.

An interactive card can also include one or more displayed inputcontrols which can be selected by user input to cause associationactions to be performed by the embedded application. When the control isselected by user input, arguments or parameters of the selected controland/or the interactive card are provided to the embedded application andthe embedded application performs the related action(s). In someexamples, the notification indicating the initiation of an embeddedsession as displayed in block 310 can be an interactive card thatdisplays the information described above, including the join option (fornon-member users) that, if selected, causes the user device to executethe embedded application and join the embedded session. In someimplementations, one or more actions are executed in the embeddedapplication in response to the user joining the embedded session, asdescribed above. In another example, an interactive card can include adisplayed control that, when the control is selected by user input,causes the embedded application to start playing a media item, triggeran in-game action (e.g., accept a different user's challenge, unlockingan in-game item, etc.), and/or other actions. The embedded applicationcan display a request in the interactive card for confirmation from theuser to perform the association action(s). In some implementations, theinformation and options in the interactive card can be continuallyupdated based on the current input received from member users (and/orchat users), current output provided by the embedded application, andcurrent processing/states of the embedded application.

In some examples, a media item is being played in an embedded sessionfor a media player embedded application, and an interactive card isdisplayed in the chat interface of the chat devices related to theplaying of the media item. The information and options can becontinually updated based on the playback of and commenting on thatmedia item by the chat users of the chat conversation. For example, theinteractive card can display an identification of each media item beingplayed or in queue for playback. The information and options in theinteractive card can be continually updated based on the playback of andcommenting on that media item by the chat users of the chatconversation. For example, the card can display one or more of thefollowing features: identifications (or the number) of the chat userswho have watched the media item (if consent from those users has beenobtained), identifications (or the number) of the chat users who havecommented on the media item (as in block 518 below, if consent fromthose users has been obtained), a displayed option to comment on themedia item for member devices (e.g., as in block 518), and a displayedoption to make the card displayed persistently on the user device, e.g.,as a reminder to the user to play the media item. If multipleinteractive cards are made persistent, a carousel display of cards canbe displayed which can be scrolled or rotated to view the multiplecards, e.g., one at a time. Causing a media item to be played in thechat conversation, or commenting on the media item (e.g., as in block518), updates a corresponding interactive card stored on each chatdevice, which can be displayed in the chat interface of each chat deviceof the chat conversation. The interactive card indicates the latestplays and comments for the media item by chat users. In someimplementations, selection of the comment option of the interactive cardby user input can cause an input field to be displayed, allowing theuser to input comments to be displayed in the embedded interface duringcurrent and later playbacks of the media item (e.g., as in block 518),and or displayed in the chat interface of the chat conversation duringcurrent and later playback of the media item.

In some implementations, interactive cards related to other types ofembedded applications can be displayed in the chat interface. Forexample, an embedded game application and session can cause aninteractive card to be displayed indicating one or more of thefollowing, if user consent has been obtained: the number of players andobservers in the game, identifications of member users, current scoresof players, game objectives achieved, one or more images showingscreenshots or portions thereof of game events or objects, a displayedoption to input a comment or rating to the game or to a particularplayer of the game (e.g., to be displayed in the chat interface, and/orin the embedded interface of member devices), a displayed option to makethe card displayed persistently on the user device, e.g., as a reminderto the user to join the embedded session, etc. Similar information anddisplayed options can be displayed in interactive cards for embeddedsessions providing content documents, travel itineraries, reservations,shopping, etc.

In some implementations, the second user exiting the embedded sessioncan be implemented similarly to joining the embedded session. Forexample, the second messaging application receives an indication thatthe second user is exiting the embedded session, e.g., by exiting thesecond embedded application, by exiting the chat conversation, or byexiting the second messaging application. The second messagingapplication sends information to the other member devices (e.g., via aserver) indicating that the second user is exiting, so that the other(corresponding) embedded applications executing for the other memberdevices can update their states (e.g., remove the user identity of thesecond user from their embedded interfaces, remove the second user as aparticipant in the embedded session, etc.).

FIG. 4 is a flow diagram illustrating an example method 400 in which afirst device of FIG. 2 processes an event in which a second device hasjoined an embedded session. In this example, method 400 illustratesblocks performed at the first device in response to the second userjoining the embedded session as described with reference to FIG. 3.

In block 402, it is checked whether user consent (e.g., user permission)has been obtained to use user data in the implementation of method 400.For example, user data can include messages sent or received by a user,e.g., using messaging application 103, user preferences, user biometricinformation, user characteristics (identity, name, age, gender,profession, etc.), information about a user's social network andcontacts, social and other types of actions and activities, content,ratings, and opinions created or submitted by a user, a user's currentlocation, historical user data, images generated, received, and/oraccessed by a user, videos viewed or shared by a user, etc. One or moreblocks of the methods described herein may use such user data in someimplementations.

If user consent has been obtained from the relevant users for which userdata may be used in the method 400, then in block 404, it is determinedthat the blocks of the methods herein can be implemented with possibleuse of user data as described for those blocks, and the method continuesto block 408. If user consent has not been obtained, it is determined inblock 406 that blocks are to be implemented without use of user data,and the method continues to block 408. In some implementations, if userconsent has not been obtained, blocks are to be implemented without useof user data and with synthetic data and/or generic orpublicly-accessible and publicly-usable data.

In block 408, an indication is received over the network at the firstdevice that indicates the second user and the second device haveconnected to (joined) the embedded session. For example, the indicationmay indicate that the second device has downloaded and/or executed acorresponding embedded application for the embedded session (or is inprocess thereof), e.g., as in block 314 of FIG. 3, and/or that embeddedapplication has synchronized (or is synchronizing) with the embeddedsession, e.g., as in block 318 of FIG. 3. For example, the indicationcan include, or be derived from, notification information as describedfor block 314 of FIG. 3. In some implementations, the first messagingapplication can receive the indication, which can include notificationinformation in some implementations, as described. The indication caninclude information indicating the joining event, a user identity of thesecond user, and any other options selected by or provided for thesecond user (e.g., user status in the embedded application, etc.). Insome implementations, the first messaging application previouslyobtained user identity information of the second user for the chatconversation, e.g., to display the user identity of the second user inthe chat interface of the first device. In some implementations, theindication is received from a server system, e.g., the session serverthat received the notification information from the second device inblock 314 of FIG. 3. In some implementations, the indication is receivedat the first device directly from the second device (e.g., apeer-to-peer configuration).

In block 410, the first messaging application provides a data update tothe first embedded application, where the update indicates the joiningof the second user to the embedded session. The embedded applicationdesignates the second user as a member user of the embedded session. Forexample, the update can include user information such as a user identityof the second user, and an indication to add the second user as aparticipant in the embedded session. In some implementations, the firstmessaging application has obtained the user identity of the second userand other user information in the chat conversation. In some examples,the user identity can be the chat identity of the second userparticipating in the chat conversation.

The user information for a particular user (e.g., the second user) canbe provided by the first message application to the first embeddedapplication if the first messaging application has obtained consent fromthe second user to do so. For example, such consent can be included inuser information provided for the chat conversation, in someimplementations. If no consent from the second user has been obtained,then the user information is not provided to the first embeddedapplication. In some implementations, the first messaging application(or a server application) can anonymize, or partially anonymize, theuser information such that the information does not describe the seconduser nor can be associated with the second user (or only partiallydescribes or is associated with the second user). For example, thesecond user chat identity can be changed to a generic name orplaceholder name such as “User 1,” “Friend 1”, the initials of thesecond user, the first name of the second user, etc. In additionalexamples, the user identity can be the real name of the second username, a user name previously registered by the second user in themessaging application, a user name previously registered in a contactlist or other data stored on and obtained from the second user device(if consent from the second user has been obtained), a user namepreviously registered in the embedded application, a placeholder name,etc. This information can be provided to and/or determined by theembedded application as a user identity for the embedded session. Insome examples, the application may choose the user name to display toother member users in one or more particular contexts of the embeddedapplication and embedded session, where different user names can bedisplayed indifferent contexts. For example, contexts can include withinthe name used in the messaging application and chat interface, the nameattached to the second user's messages composed within the messagingapplication, the name used within the embedded application and itscontent data, the name attached to chat messages or system messagesgenerated by the embedded application, etc.

In some implementations, the user information can include a user status(e.g., role) selected by or provided for the second user, geographiclocation of the second device, and/or other information related to thesecond user, if consent has been obtained from the second user for useof such information. The first embedded application can update itsprocessing based on the addition of the second user, e.g., display theuser identity of the second user in the embedded interface, check forinput from the second user, etc. In some implementations, the firstmessaging application also designates the second user as a member userof the embedded session, e.g., updates its own session user list for theembedded session to add the second user identity.

In block 412, the first embedded application (and/or first messagingapplication) may determine one or more user statuses for the seconduser. In some implementations, the user status can be determined basedon the user information received from the first messaging application,e.g., in block 410. For example, the user information can include a userstatus for the second user in the embedded session. The user status mayhave been selected by the second user, and information indicating thisselection may have been provided to the first embedded application bythe first messaging application. For example, a user role of “observer”for a game embedded application may have been selected by the seconduser, and the first embedded application assigns this role to the seconduser.

In some implementations, the first embedded application (and/or thecorresponding embedded applications executing on other member devices)can generate the user status or role. In some implementations, a server(e.g., a session server) can generate the user status or role andprovide the determined user status to the first messaging applicationand first embedded application. In some examples, the user status can beassigned based, at least in part, on one or more current states of thefirst embedded application and/or embedded session. For example, if oneor more roles are available to be assigned to a joining user, then thesecond user (joining user) can be automatically assigned to an availablerole (e.g., player in a game). If the embedded session does not have anyselected roles available, the second user can be assigned to another(e.g., default) role. For example, if the second user selected to beassigned a player role but no player roles are available, the seconduser can be assigned an observer role. In some implementations,particular states and/or data can be stored (e.g., on a server) fromprevious embedded sessions that a particular user has participated in,such as user statuses and roles previously assigned to the particularuser in previous embedded sessions using the same embedded application,e.g., if privacy and security measures are performed for such states anddata. In such implementations, a history of use of embedded applicationsof the second user can be used in determining a user status or role forthe second user, if second user consent has been obtained for such useof user data. For example, if the second user has been a referee role ina threshold number of previous embedded sessions using this embeddedapplication, then that role can be automatically assigned to the seconduser. In some implementations, the second device can be sent a prompt(e.g., by a member device and/or session server) to allow the seconduser to accept or reject a particular user status or role that has beenautomatically assigned to the second user in the embedded session.

In some implementations, other user statuses and roles can be determinedfor users in an embedded session. For example, a user can be assigned a“controller” or “leader” role if the user initiates the embedded session(e.g., the first user), where the controller is the only user to be ableto modify data processed in the embedded session, e.g., change theplayback point in a media item, change data in a shared contentdocument, etc. In some examples, the second user can be assigned ahandicap or advantage as a player in a game of the embedded applicationbased on history of the second user in previous games similar to theembedded session.

In some implementations, the user status can be determined based onmessages and other user input provided in the chat conversation fromwhich the embedded session was initiated. For example, the messagingapplication can parse the second user's text messages (or text messagesderived from second user voice input) to match predefined words orphrases, and/or use other language processing techniques to determinesemantic meanings of user input to the chat conversation. For example,the second user may have previously input into the chat conversation,“let's play!” or “I'll watch you two,” indicating that the second userintends to be a player role or an observer role, respectively, in theinitiated embedded application game. The second user may have input,“I'll show you the place in the video,” indicating that the second usershould be assigned a controller role that has control over a playbackposition in a played video in the embedded session.

In some implementations, a member user that is assigned a particularstatus or role in the embedded session may have a status or role that ischanged, and/or may select to change his or her status or role to adifferent status or role, while continuing to be a member user. Forexample, a user that is assigned a player role in the embedded sessionmay automatically become an observer user based on certain conditions,e.g., the user's player character has been eliminated in a game, becomesa “ghost” that can only observe and move within the game environment butnot act to change objects within the environment, or, e.g., in a2-player game, the player is offline for longer than a threshold periodof time and loses player status, while an online observer user isautomatically assigned the player role by the embedded application. Inanother example, in turn-based games where a player user is only activeduring their turn, the player may automatically become an observerplayer when their turn is not currently active. In further examples,predefined additional user statuses or roles may become permanently ortemporarily available in an embedded session, and/or existing userstatuses or roles may become permanently or temporarily unavailable inthe embedded session, during the embedded session. For example, suchuser status or role changes can occur based on a change in the number ofmember users currently in the embedded session, a length of time thesession has been active, a member user indicating he or she is doing anexternal task such as answering a phone call, particular eventsoccurring in the embedded application (game events, completion of ashared list, etc.), etc.

In some additional example implementations, a lobby can be provided inthe embedded application and embedded interface, e.g., a displayed arealisting the member users who do not yet have an assigned role. Forexample, such users can wait to be assigned a user status or role in agame, e.g., wait for a game to finish, wait for a player user to changeto a non-player role, etc. In some examples, a subset of the memberusers can be associated with a sub-session within the embedded session,where the subset of users interact via the embedded application withinthe sub-session and other member users have different ability or noability to interact. For example, an embedded session can includemultiple sub-sessions, each sub-session associated with a differentsubset of the member users. In some examples, each sub-session can be aparticular game within a tournament structure executed in the overallembedded session, where each game is executed simultaneously and thewinner of each game plays each other in a new game. In some examples,two or more users in a lobby can be associated with each other and/or beassigned particular roles in a sub-session (e.g., individual game) thatis initiated in the embedded session. Team-based implementations canalso be provided, where users that join the embedded session areassigned to an existing team in a particular game, and each team hasmultiple players. In some examples, the embedded session can providemultiple games running in parallel, a single game with two players and Nobservers, a single game with two teams and N players per team, etc. Insome implementations, multiple such sub-sessions can be implemented asseparate concurrent embedded sessions, each embedded session provided bya single embedded application.

In block 414, the first embedded application updates its output in theembedded interface based on the addition of the second user. Forexample, a second user identifier can be displayed in the embeddedinterface, as well as the second user status (user role, etc.).

In block 416, the first embedded application provides determined userstatus information to the first messaging application. For example, ifthe first embedded application determined a user role and/or other userstatus information, this is provided to the first messaging application.In some implementations, the first messaging application can update asession list of users, output the user status information in the chatinterface, etc.

In some implementations, the second user exiting the embedded sessioncan be implemented similarly to joining the embedded session. Forexample, the first device can receive an indication over the networkthat the second user is exiting the embedded session, e.g. by exitingthe second embedded application, by exiting the chat conversation, or byexiting the second messaging application. The first messagingapplication sends information to the first embedded applicationindicating that the second user is exiting, so that the first embeddedapplication can update its states (e.g., remove the user identity of thesecond user from the embedded interface and no longer expect input fromthe second user).

In some implementations, a user device can cache a state of the embeddedapplication to enable offline mode, where the user device (and/or themessaging application) is no longer visible over the network to theother user devices and server devices. When the user device (and/ormessaging application) goes back online, the cached state of theembedded application can be used to synchronize the embedded applicationwith the other member devices and corresponding embedded applications,and provide merge/conflict resolution. In some examples, before the userdevice loses network connectivity, the embedded application can firstwrite any state changes to storage on the user device. While the userdevice is online, the local state is constantly synchronized with aserver global state stored on a server, where the global state is sharedby the instances of the embedded application executing on the memberdevices in the same chat conversation. On loss of network connectivity,the local state can be accessed and written to by the embeddedapplication on the user device, but no client-to-server synchronizationcan occur. Once network connectivity is restored to the user device, thelocal state is synchronized with the global state (e.g., pullingserver-side changes and pushing client-side changes) and a merge occurs,using conflict resolution if needed (e.g., using a last-write-winsstrategy or other merging strategy). This offers limited offlinesupport, e.g., it provides protection against short-term networkdisconnections that are common among mobile devices during cell towerswitches or environmental changes (such as going underground, etc.). Ifusers are offline for a longer period of time, the local state on theuser device may diverge significantly from the server global state.

FIG. 5 is a flow diagram illustrating an example method 500 to provideoutput of a media item using an embedded application in association witha messaging application. In some examples, method 500 can be implementedsimilarly as one or more blocks of FIG. 2 in which an embeddedapplication is initiated from a chat conversation and data is processedin an embedded session involving chat users.

In block 502, it is checked whether user consent (e.g., user permission)has been obtained to use user data in the implementation of method 500.For example, user data can include messages sent or received by a user,e.g., using messaging application 103, user preferences, user biometricinformation, user characteristics (identity, name, age, gender,profession, etc.), information about a user's social network andcontacts, social and other types of actions and activities, content,ratings, and opinions created or submitted by a user, a user's currentlocation, historical user data, images generated, received, and/oraccessed by a user, videos viewed or shared by a user, etc. One or moreblocks of the methods described herein may use such user data in someimplementations.

If user consent has been obtained from the relevant users for which userdata may be used in the method 500, then in block 504, it is determinedthat the blocks of the methods herein can be implemented with possibleuse of user data as described for those blocks, and the method continuesto block 508. If user consent has not been obtained, it is determined inblock 506 that blocks are to be implemented without use of user data,and the method continues to block 508. In some implementations, if userconsent has not been obtained, blocks are to be implemented without useof user data and with synthetic data and/or generic orpublicly-accessible and publicly-usable data.

In block 508, a selection of a media item by a chat user is obtained,the selection instructing playback (e.g., output) of the media item by auser device. The chat user is participating in a chat conversation withone or more other chat users using devices connected to the user deviceand each other by a network, where the chat conversation is displayed ina chat interface by a device similarly as the first and second users andfirst and second devices described above. The media item can be selectedin any of various ways. For example, an identifier of the media item canbe input via text, voice input, selection of a displayed element or anitem from a displayed menu, etc. In some implementations, the media itemis selected from within the chat interface, e.g., via text command,interface element displayed in the chat interface, etc. In someimplementations, user input can also explicitly indicate to share themedia item with the chat conversation by selecting or inputting a shareoption (e.g., an interface element, text command or parameter, etc.).Sharing the media item can include making the media item available forplayback on the other devices by offering an embedded session to theother chat users of the chat conversation. Some implementations canautomatically offer the media item in an embedded session in the chatconversation when the media item is selected for output. In someimplementations, the media item can be selected within an embeddedinterface after an embedded media player application is initiated asdescribed in block 510. In some implementations, a bot can be used toselect a media item, some examples of which are described below. Themethod continues to block 510.

In block 510, an embedded media player application is executed (e.g.,initiated) in response to the selection of the media item. The embeddedmedia player application is configured to output the selected mediaitem. In some examples, the embedded media player application isdownloaded to the user device from a server similarly as described aboveand executed at least partially on the user device. In someimplementations, the embedded media player application can be executedpartially or in whole on a device in communication with the user device,e.g., a server, and provide data (e.g., data describing the embeddedinterface) for display on the user device. The embedded media playerapplication causes display of an associated embedded interface on theuser device in association with the chat interface (e.g., similarly asdescribed above) such that one or more chat messages in the chatinterface can be displayed during display of the embedded interface. Insome implementations, the embedded media player application can beinitiated in response to user input instructing that the embeddedapplication be executed without specifying the media item to be played.For example, the media item can then be selected by user input providedto the embedded interface, e.g., after user input browses displayedmenus of available media items in the embedded interface, etc. Themethod continues to block 512.

In block 512, other chat users are enabled to join or leave an embeddedsession that is initiated in association with the start of the embeddedmedia player application, where the embedded session can includeplayback of the media item. For example, a notification can be sent tothe chat devices participating in the chat conversation and one or morechat users can join the embedded session as member users, similarly asdescribed above for FIGS. 2-4. The method continues to block 514.

In block 514, playback of the selected media item is performed in theembedded interface provided on a display of the user device by theembedded media player application. For example, after selection of themedia item in block 510, the playback is initiated at the start of asequence of content data of the media item, e.g., a first frame of avideo data segment and/or first portion of an audio segment. In someexamples, the playback can include displaying frames of video data inthe embedded interface and/or outputting corresponding audio data asaudio from speakers of the user device. In some examples, the playbackcan include playing a track for video and/or audio, and playbackposition can refer to the data which is currently displayed or output ata current time point in that track. In some further examples, e.g., indisplaying a virtual reality environment or other displayed 3Denvironment, playback may have a playback position that refers todirection and/or orientation of a displayed point of view (or otherreference view) in a 3D environment, in addition or alternatively to atime point. In some cases, the media item content data can be obtainedfrom local storage of the user device, e.g., memory and other storageincluded in the user device. In some cases, the media item content datacan be received over the network, e.g., as a stream of data from anotherdevice such as content server 154, a different member device, etc. Insome implementations, playback of a video media item can default tomuted audio and displaying captions for speech (e.g., where caption datais included in received video data), where the user can select to enableaudio output for the video data.

Playback of the media item occurs on the other member devices of theembedded session. In some implementations, a server (e.g., sessionserver or content server) can manage playback of the media item in theembedded session. In some implementations, the content server can streamthe content data to a session server or other server, which manages theembedded session and sends an individual stream of the content data toeach member device. For example, the session server can send anycommands received from the member devices to the content server or canprocess the commands into particular command for the content server. Insome implementations, a content server can stream the content dataindependently to each member device of the embedded session, and canreceive commands based on user input from one or more of the memberdevices. Changes made to the playback based on the commands (e.g., inlater blocks of method 500) can be provided in all the streams to themember devices.

Playback is synchronized among the member devices. In someimplementations, the synchronization can be managed by one or moreservers. For example, a content server providing the media item as astream of data to each member device can synchronize each stream of datausing synchronization data, e.g., a reference position, such that theplayback on each member device is synchronized. In some implementations,a session server can store a reference position (or othersynchronization data), such as a reference frame or time position withinthe media item data sequence, that can be accessed by member devicesand/or sent to member devices by the session server. For example, theplayback of the media data can be set to a frame (or time point) on eachmember device equal to the reference position. In some implementations,the synchronization can be managed by one or more of the member devices.For example, one of the member devices (e.g., the user device) can be areference device that sends synchronization data (e.g., referencepositions) to the other member devices that indicates the currentposition in the media data being played on the user device. The othermember devices can adjust the playback of the media item on thosedevices to synchronize with the reference position of the referencedevice.

In some examples, a shared playback timer can be used which can bestored and accessed on a database of a device accessible to all memberdevices (e.g., a session server, content server, or one of the memberdevices). For example, a single reference value can act as anauthoritative playback position (e.g., a global playback position) towhich all member devices should synchronize. In some implementations, atolerance (e.g., threshold amount of time) can be allowed between theglobal playback position and the playback positions on the memberdevices, e.g., plus or minus 5 seconds. If a member device's playbackposition is at a time greater than the tolerance amount, that playbackposition is updated to the global playback position.

In some implementations, multiple or all member devices can update theshared timer (global playback position) in an averaging manner. Forexample, during playback, each member device attempts to synchronizewith the server each second (or other time unit), which is a “syncpoint.” At each sync point, each member device attempts to increase theglobal playback position. In some examples, the amount of increase canbe determined using the following formula:

$g^{\prime} = {g + \frac{\begin{matrix}{\left\lbrack {{Device}\mspace{14mu} {current}\mspace{14mu} {playback}\mspace{14mu} {position}} \right\rbrack -} \\\left\lbrack {{Device}\mspace{14mu} {previous}\mspace{14mu} {playback}\mspace{14mu} {position}} \right\rbrack\end{matrix}}{\left\lbrack {{Total}\mspace{14mu} {number}\mspace{14mu} {of}\mspace{14mu} {member}\mspace{14mu} {devices}} \right\rbrack}}$

where g is the global playback position and g′ is the increased globalplayback position. For example, the device previous playback position isat the previous sync point, and the total number of member devices isthe number of member devices in the embedded media session (e.g., if allmember devices are able to update the global playback position). Thus,each device updates the global playback position by a fractional amountthat is based on the increase in playback position of that device sinceits last sync point, divided by the number of member devices. If thedifference between the increased playback position g′ and the [Devicecurrent playback position] is greater than the tolerance value, thedevice maintains or changes the playback position to g (and does notcommit g′). Otherwise, the device commits g′ to the database. The methodcontinues to block 516.

In block 516, user input is received from a member user in an embeddedinterface. For example, the user input can be received from the user ofthe member device that initiated the embedded session in block 508, orthe user input can be received from a different member user of adifferent member device. The user input can be received in the embeddedinterface, e.g., selection of a displayed interface element such as abutton, icon, slider control, etc. In some cases, the user input can bereceived, or partially received, in the chat interface. For example,user input can select an option to input a user comment directly ontothe displayed media item, and then further user input can input the usercomment in the chat interface, e.g., as text, emoji, rating symbol, etc.The method continues to block 518.

In block 518, it is checked if the received user input is a user commentassociated with the playing media item. For example, such an associateduser comment is input in the embedded interface such that the usercomment is displayed during display of the media item. For example, theuser comment can be displayed during the playback for a predefinedamount of time after being input. In some examples, the user comment canbe superimposed on a display of video data, or otherwise displayed inthe embedded interface. In some implementations, the content of the usercomment can be input in the chat interface, as described above, and thendisplayed in the embedded interface. For example, the user input canselect an option in the embedded interface to input the comment, andthen the comment is input via the chat interface. In someimplementations, the user input can also select or point to a particularlocation at which to display the user comment in a displayed area of theembedded interface, such as a location in a display window or view ofthe media item. For example, the location can be specified ascoordinates of the location of the comment in the displayed view of avideo, image, or other media item. In further examples, the user cantoggle (e.g., tap) or continuously select one or more of multiplecontrols displayed in the chat interface or embedded interface that areassociated with an emotion or mood of the user (e.g., emoticon buttons).This selection causes an associated image or icon (e.g., emoticon) to bedisplayed in the embedded interface (as described below) while the userselects the control or until the user again toggles (e.g., taps) thecontrol, which represents the user's emotion at that time in response tothe playback of the media item.

If the user input is a user comment, then in block 520, the user commentis stored in association with an identification of the associatedportion of the media item that was displayed when the comment was inputand/or displayed. In some implementations, the identification of theassociated portion includes an identification of the media item (e.g.,title, identification value, etc. of the media item). For example, theidentification of the associated portion of the media item can indicatethe media item context of the user comment. In some examples, if a usercomment was input at a time of 1 minute after the start of playback of a5-minute video segment, then the associated portion of the media item isthe content data of the media item at the 1 minute time point of thevideo segment (e.g., a threshold amount of data before and/or after the1 minute time point). In some examples, this portion can be identifiedby the time point, e.g., indicating where the portion starts or a middlepoint of the portion. In some implementations, the identification caninclude a duration of the portion. In some implementations, anidentification of the user who provided the comment can be stored (e.g.,an identification of the user as displayed in the embedded session, or achat identity in the chat conversation). In some implementations, anindication of a location of the user comment relative to a displayedarea of the media item can be stored in association with the usercomment. For example, coordinates referencing the area of a displayedembedded interface window, or the area of a media display window in theembedded interface, can indicate the location where the user comment waspositioned by the user. The method continues to block 522.

In block 522, identification of the associated chat conversation isstored in association with the user comment. This allows, for example,the user comment (and other user comments input and stored for embeddedapplications associated with the chat conversation) to be retrieved anddisplayed during later playback of the media item for users of the samechat conversation (e.g., for member users from the same group of chatusers who participated in the chat conversation when the user commentwas input). The user comment will not be retrieved and will not bedisplayed for future playback of the media item in an embedded interfaceassociated with a different, second chat conversation. For example, thatsecond chat conversation can have its own set of associated usercomments to display during playback of the media item, which were inputto an embedded media player application associated with the second chatconversation. In some implementations, the user comment is not retrievedand displayed for later embedded playback of the media item in otherchat conversations or by other users.

In block 524, the user comment is displayed in the embedded interface ofthe member device at which the user comment was received, and the usercomment is sent (e.g., via the messaging application on the user device)to other member devices during the current playback such that the usercomment is displayed in the embedded interfaces of the other memberdevices. In some examples, the user comment is displayed for apredetermined period of time during the playback of the media itembefore being removed from display in the embedded interface. The periodof time can be determined based on user preferences, settings for theembedded session, etc. In some implementations, the user comment isdisplayed in response to selection of an associated control by the user,e.g., a toggle or continuous pressing of a displayed control asdescribed above, and the user comment is removed from display when theuser stops selecting the control or again toggles the control. Themethod can then continue to block 512 to enable users to join or leavethe embedded session and perform playback of the media item in block514.

If the user input is not a user comment as determined in block 518, thenthe method continues to block 526 where it is checked whether the userinput is a selection of a seek point in the media item. In someexamples, the user can select a seek point on a graphical progress baror timeline displayed in the embedded interface which represents theentire play length of the media item. In other implementations, the seekpoint can be selected in other ways, e.g., by receiving input specifyinga particular time along the timeline, by receiving selection of a fastforward or rewind control that moves the playback forward or back alongthe timeline, etc.

If the user input is a selection of a seek point, then in block 528, theplayback position of the media item is updated to the seek point. Forexample, in some cases where the seek point has moved the playbackposition from its former position, the playback of the media item can bediscontinued from its former position and continue at the updated seekpoint. The method continues to block 530.

In block 530, the seek point information is sent to synchronize playbackof devices. For example, information describing the seek point, such asa time value of the adjusted seek point or other value, etc., can besent to the other member devices (e.g., via the messaging application)to synchronize the playback of the media item on those devices with theplayback on the member device that received the updated seek point froma user. In some implementations using a shared timer and/or globalplayback position as described above, the member device overwrites thevalue of the global playback position (g) with the new value of theplayback position at the seek point. The method can then continue toblock 512 to enable users to join or leave the embedded session andperform playback of the media item in block 514.

If the user input does not select a seek point as determined in block526, then the method continues to block 532, where one or more device orapplication functions can be performed based on the received user input,if applicable. The method can continue to block 512 in some cases. Insome implementations, the method continues to block 534 in response to alater playback of the media item.

In block 534, associated user comment(s) that were stored in associationwith the media item and chat conversation are displayed during laterplayback of the media item in the same (e.g., ongoing) chatconversation. The associated user comments can be displayed in theembedded interface during the later playback. For example, in someimplementations, if the media item received one or more user commentswhich were stored in association with the media item in blocks 518 to524, then the associated user comments can be displayed in conjunctionwith later playback of the associated portions of the media item by achat user. In some examples, if the media item is played in the embeddedinterface in the chat conversation (e.g., having the same conversationID, or having the same participating chat users as when the comment wasoriginally input, or having a subset of the original chat users), and aportion of the media item that is associated with one or more usercomments is displayed, then the associated user comments are retrievedfrom storage and also displayed in the embedded interface along with theassociated media item portions. In some examples, the associated usercomments can be displayed at the same location in the embedded interfaceat which they were input, e.g., same coordinates in a playback window,if the interface locations of user comments has been stored. In someexamples, after a predetermined time duration or amount of media itemdata has been played, the associated user comment(s) can be removed fromthe embedded interface. In some implementations, the user comments canalso or alternatively be displayed in the chat conversation of the chatinterface during the later playback, e.g., as chat messages. In someimplementations, the user comments may be displayed as a list below ornext to the display of the media item during playback or accessible viaa control on a playback interface in the embedded interface (e.g.,switching between comment view and playback view).

In further examples, as described above, user comments may have beenstored in association with a period of time of playback of the mediaitem while the user continuously selected or toggled a control, andthese user comments can represent the user's emotion or thoughts duringthe corresponding portion of the media item playback (e.g., viaemoticons, images, etc.). With multiple such user comments stored frominput from multiple users who previously viewed the media item, thisallows synchronization of the thoughts and emotional states of memberusers who were concurrently watching and commenting on the media item.The user comments for corresponding portions of the media item can bedisplayed as markers or icons on a time bar or as overlays on thedisplay of the media item (e.g., displayed over video frames), where auser comment can be displayed in full upon selection of an associatedmarker or icon. Such user comments can register the thought andemotional state changes in users during replay (later playback) of themedia item by same or different users within the same chat conversation.

In some implementations, a save feature can be provided to allow a userto save a playing media item for later playback. This can be useful formedia items with relatively long durations (e.g., movies or TV shows)that may not often be viewed in chat conversations. In some examples, auser can be allowed, via provided user input, to access an associatedrepository of unplayed media items, e.g., stored on the user deviceand/or on a server (e.g., session server or messaging server), allowingthat user to play the media items at a desired time, all in successionat one time, etc. For example, the saved media items may have beenpreviously played by other chat users, and the user did not participatein those embedded sessions.

In some examples, each media item played in an embedded session (e.g.,initiated by a different chat user) can be associated with a displayedoption (e.g., UI element) in the chat interface and/or embeddedinterface to save the media item for later playback. For example, thisoption can be displayed in association with a notification received bythe user device that indicates that an embedded session is active (andwhich also can include a join option), as described with reference toFIGS. 2-3. This option can also or alternatively be displayed within anembedded interface, e.g., next to or otherwise in association with adisplayed list of identifications of media items playing and to beplayed in the embedded application. Selection of the option by userinput causes that media item to be stored into a queue associated withthe selecting user. In some examples, the media item can be stored in adifferent chat conversation in which the user and a particular botparticipate. In some implementations, a user can request toautomatically save all media items initiated by other chat users inembedded sessions in a chat conversation. Any media item stored in thequeue can be later selected and played in an embedded session for theembedded media player application that is then initiated to play themedia item. In some implementations, the embedded interface and/or chatinterface can receive comments from the user during the later playback,where the comments are displayed in the embedded interface and/or sentand provided to the chat conversation in which the media item wasoriginally played. In some examples, when a media item from the queue isselected for later playback, a comment control is displayed to enablecomments on the selected media item to be input by the user. In someimplementations, selection of the comment control can display theoriginating chat conversation, insert a media item link as a message inthe chat conversation, and enable the user to compose comment messagesin the chat conversation. In some implementations, a link to a saved orplayed media item can be displayed as a selectable message in the chatconversation (e.g., an image of a video with a play button, or a textmessage), such that selection of the message by a chat user causes themedia player embedded application to be initiated and the selected mediaitem to be played. Some implementations can provide a similar savefeature for other types of content data output in other types ofembedded applications, e.g., game data displayed over time (e.g., torecord a particular play of a game), document data, travel itineraries,etc.

In various example implementations that can use features describedabove, a selection of a media item is received in a first chatconversation that includes a plurality of participants. For example, thechat conversation can be implemented on multiple user devices connectedby a network. The media item can be provided by a user device and/or aserver connected to one or more of the user devices by the network.Playback of the media item is initiated in the first chat conversationsuch that the media item is displayed by the user devices of theparticipants. A comment is received from a first participant, thecomment being associated with the media item and associated with aparticular portion of the media item. The comment is stored, and, afterstoring the comment, a user device of a second participant is detecteddisplaying the particular portion of the media item. In response todetecting that the user device of the second participant is displayingthe particular portion, the comment is caused to be displayed by theuser device of the second participant.

Features for these implementations can additionally include displayingthe comment by the second participant's user device in response todetermining that the second participant is a participant of the firstchat conversation in which the first participant was participating inwhen the comment was received. Storing the comment can include storingidentification information that is associated with the comment, wherethe identification information includes an identification of the firstchat conversation. In some examples, the identification information canalso include an identification of the media item, and an identificationof the particular portion of the media item. The comment can include arating and/or a user comment. In some examples, the playback of themedia item in the first chat conversation is synchronized among the userdevices of the participants, e.g., by providing a reference numberaccessible by the user devices over a network, where each of the userdevices attempts to synchronize with the reference number at regulartime intervals.

In further examples, initiating the playback can be performed on a firstuser device of the user devices, and a notification can be provided toone or more other user devices that the playback of the media item hasbeen initiated by the first user device. The other user devices senddata (and/or request) to join the playback, and the other user devicesare added to an embedded session including the first client device. Inresponse to adding the user devices, the playback of the media item issynchronized on the other user devices to a current playback position onthe first client device. In another example, initiating the playback ofthe media item includes displaying data of the media item in an embeddedinterface displayed on each of the user devices in association with thechat conversation provided by a messaging application. The embeddedinterface is provided by an embedded application executing inassociation with the messaging application.

In some example implementations, a selection of a media item is receivedon a first client device from a first participant of the participants ina chat conversation. A first command is sent to one or more clientdevices associated with the participants to initiate playback of themedia item. User input is received, indicative of a seek point in themedia item on a second client device from a second participant. Inresponse to the user input, a second command is sent to the one or moreclient devices associated with the plurality of participants to updateplayback of the media item to the seek point.

For example, the media item can be a first media item. Input can bereceived from the second participant selecting a second media item, andthe second media item can be added to a playlist queue indicating anorder of playback of the first media item and the second media item. Asynchronization of the playback of the media item can be performed forthe first client device and the one or more client devices, includingupdating a global value indicative of the position of the playback. Insome implementations, a notification is provided to the one or moreclient devices associated with the plurality of participants that theplayback of the media item has been initiated, and indication isreceived that the one or more client devices are to join the playback,the one or more client devices are added to an embedded sessionincluding the first client device, and, in response to adding the one ormore client devices to the embedded session, the playback of the mediaitem is synchronized on the one or more client devices to a currentplayback position on the first client device. In some example,initiating the playback of the media item in the first chat conversationincludes displaying data of the media item in an embedded interfacedisplayed on each of the user devices in association with the chatconversation provided by a messaging application.

FIG. 6 is a flow diagram illustrating another example method 600 toprovide output of an embedded application in association with amessaging application. In some examples, method 600 can be implementedsimilarly as one or more blocks of FIG. 2 in which an embeddedapplication is initiated from a chat conversation and data is processedin an embedded session involving chat users.

In block 602, it is checked whether user consent (e.g., user permission)has been obtained to use user data in the implementation of method 600.For example, user data can include messages sent or received by a user,e.g., using messaging application 103, user preferences, user biometricinformation, user characteristics (identity, name, age, gender,profession, etc.), information about a user's social network andcontacts, social and other types of actions and activities, content,ratings, and opinions created or submitted by a user, a user's currentlocation, historical user data, images generated, received, and/oraccessed by a user, videos viewed or shared by a user, etc. One or moreblocks of the methods described herein may use such user data in someimplementations.

If user consent has been obtained from the relevant users for which userdata may be used in the method 600, then in block 604, it is determinedthat the blocks of the methods herein can be implemented with possibleuse of user data as described for those blocks, and the method continuesto block 608. If user consent has not been obtained, it is determined inblock 606 that blocks are to be implemented without use of user data,and the method continues to block 608. In some implementations, if userconsent has not been obtained, blocks are to be implemented without useof user data and with synthetic data and/or generic orpublicly-accessible and publicly-usable data.

In block 608, an embedded application has been initiated and executes toprovide display output in an embedded interface on a user device inassociation with a messaging application providing a chat conversation,where the user device is one of multiple member devices participating inthe chat conversation which have joined an embedded session associatedwith the embedded game application, similarly as described above forFIGS. 2-4. The method continues to block 610.

In block 610, it is determined whether local input has been received tothe embedded application executing on the user device. For example,local input can include user input received from the user of the userdevice on which the embedded application executes. If local input hasbeen received, the method continues to block 612, where one or morestate(s) of the embedded application are updated based on the localinput. For example, the local input may include one or more commands tothe embedded application which cause one or more application states tobe changed. In this example, an application state can include a statethat is updated in all the embedded applications of the member devicesof the embedded session. For example, in a game application, the updatecan be to a game state, e.g., a change in position of one or moredisplayed game objects, a change in score, etc. In a media playerapplication, the update can be to a playback characteristic of a playingmedia item, e.g., change playback position, stop, pause, rewind, fastforward, etc. In some cases, a state updated at the user device may notbe updated at the other member devices, e.g., a change in a view of anenvironment as displayed in the embedded interface (e.g., a gameenvironment) may not be updated at the other member devices if the viewon each member device is independently controlled by the user of thatdevice in that particular embedded application. The method continues toblock 614.

In block 614, the updated state is sent to the other member devices ofthe embedded session, if the updated state is of a type that is updatedamong the member devices. For example, the embedded application canprovide data describing the updated state to the messaging application,and the messaging application can transmit the data to the other memberdevices of the embedded session. The method continues to block 616.

If local input was not received in block 610, or after block 614, themethod continues to block 616, where it is determined whether input hasbeen received from one or more of the other member devices of theembedded session over the network (e.g., remote input). If such inputhas been received, the method continues to block 618, where theapplication state is updated based on the input. For example, the inputmay indicate an updated application state of the corresponding embeddedapplication on a different member device, and the application state ofthe embedded device on the user device is updated to synchronize withthe other member devices. The method continues to block 620.

If input was not received in block 616, or after block 618, the methodcontinues to block 620, where it is determined whether one or moremessage conditions have occurred in the embedded application or themessaging application for one or more non-user application objectsprovided in an application environment. For example, the applicationenvironment can be a game environment, and the one or more non-userapplication objects can represent, for example, characters or entitieswithin the game environment that are not controlled by any of the playerusers in the embedded session, e.g., a non-player game entity that theplayer users of the game can interact with in the game environment. Inanother example, application objects (game objects) can includenon-player game characters playing with or against the player users ofthe game, such as a simulated opponent or team member. In anotherexample, the application environment can be a media player environmentdisplaying a media item, and a non-user application object can be acharacter in displayed content data (e.g., a character in a movie orimage). In some examples, the application object can be an assumedcharacter or persona adopted by a bot and displayed as a character.

A non-user application object can be enabled to output a message. Forexample, if the application object is a character, the message can be inaccordance with the character's actions or role in the embeddedapplication and session. In some implementations, multiple differentapplication objects can be implemented in the embedded session that mayoutput different types of messages.

One or more message conditions can be predefined and stored, and can bechecked during embedded application execution. The message conditionsmay cause an associated application object to output a chat message ifthe message condition occurs. For example, a particular applicationobject can be associated with one or more message conditions, such thatif the one or more message conditions occur (or, alternatively, if anyone of the one or more message conditions occur), the associatedapplication object(s) are designated to output a predefined message or amessage to the chat conversation determined based on a currentapplication state, current member users, etc. A variety of messageconditions and/or types of message conditions can be defined to triggerthe output of a message by one or more associated non-user applicationobjects. A message condition can include, for example, an eventoccurring in the application environment which affects the applicationobject (e.g., a player-controlled object colliding with the applicationobject, a user inputting a request addressed to an applicationcharacter, etc.). A message condition can include, for example, one ormore member users joining or exiting the embedded session. A messagecondition can include, for example, a user action against or assisting aparticular character in the application environment.

In some implementations, message conditions can include the input ofparticular chat messages or types of chat messages by member users inthe chat conversation. For example, the input chat messages may refer toan application object. In some examples, if a player user in a gamesession inputs a message in the chat conversation such as “let's goafter that enemy on the left,” this message can be parsed and analyzedby the messaging application (or embedded application, otherapplication, or server) and determined to refer to a specific gameobject. This can satisfy a message condition associated with that gameobject that is triggered when a player message refers to the gameobject. If no message condition has occurred, the method can continue toblock 608.

If a message condition has occurred as determined in block 620, themethod continues to block 622, in which object identities of theapplication objects which are associated with the message condition areprovided from the embedded application to the messaging application. Forexample, the object identities can be labels that provide names of theapplication objects as displayed by the embedded application andsession, or can be other types of identifiers of application objects. Inaddition, in some implementations, message data associated with theapplication object and with the message condition can be provided fromthe embedded application to the messaging application in block 620. Themessage data can be text or other form of message (e.g., image, symbols,audio message, etc.) or can be an indication of the message (e.g., aflag or value indicating a particular message or type of message). Insome implementations, the embedded application can provide the messagecondition(s) that were detected to have occurred to the embeddedapplication. The method continues to block 624.

In block 624, the messaging application assigns a chat identity to eachapplication object. In some examples, the chat identity is a chat namethat is provided by the embedded game application, or the applicationobject can be assigned a chat name by the messaging application based ondata received from the embedded application. In some implementations,the messaging application can determine the message for the applicationobject based on message data provided by the embedded application. Forexample, the messaging application can receive a value from the embeddedapplication that corresponds to a particular text message in a look-uptable or other data structure. In some implementations, the messagingapplication can receive one or more message conditions that weredetected to have occurred in the embedded application, and determineassociated messages based on the message conditions. In some examples,the messaging application can send data descriptive of the occurringmessage conditions to a server that can determine a message for theapplication object and send the determined message to the messagingapplication. The method continues to block 626.

In block 626, a message associated with each determined chat identityfor an application object is output in the chat interface in the chatconversation. Each chat identity represents an associated applicationobject that provides a message in the chat conversation to chat users(e.g., member users only in some implementations). This allows themember devices of the embedded session to display the message in theirchat interfaces and the member users to view the message. In someimplementations, the messaging application can output the message in thechat interface of one or more particular member devices and not in thechat interface of other member devices, e.g., a direct message output inthe chat interface of one or more particular member devices. Forexample, if a particular application object is to provide a message to asubset of the member users due to being interacted with by those usersin the application environment (e.g., via user-controlled applicationobjects or by direct input from the member users), then the message canbe sent to and displayed by the member devices of that subset of users.

The output message can take a variety of forms and can be based on themessage condition and a set of stored messages associated with thatapplication object. For example, if the message condition is met by oneor more member users joining an embedded game session and the associatedgame object is a player-enemy game object (e.g., character), the outputmessage for that game object can be, “Another victim!” A similar messagecondition can be associated with a friendly-to-players game object(e.g., character) which can provide a message such as, “Welcome, User.”In another example, in response to a message condition being met by anewuser joining the embedded session, an associated application object(e.g., character) can provide assistance to the new user by sending oneor more messages including hints or tips for application user (e.g., howto play the game) that are displayed only in the new player's chatinterface. In another example, if a message condition is met by an eventin the embedded application occurring to an application object, theassociated message can include a description of the status of theapplication object (e.g., a game character that says, “I need help fromall of you” or “beware, I am stronger”). In another example, if amessage condition is met by a user action against a non-user applicationcharacter, the non-user character can provide messages such as taunts(e.g., in a game, “your efforts are useless”). In another example, if amessage condition is met by user actions that assist a non-userapplication object (e.g., a character), the application object canprovide messages that thank the assisting users (e.g., “your help wasgreatly needed”). In another example, a message condition can be met bythe input of a particular user chat message from a member user in thechat conversation, where the chat message refers to a game object (e.g.,“let's go after that enemy on the left”). In response to the messagecondition being met, the associated message output by a chat identityrepresenting the game object can include text such as, “You will find mea worthy opponent.” In some implementations, such messages can includeimages, emojis, or other types of data.

Examples of Providing Suggested Items in Association with EmbeddedApplications

FIG. 7 is a flow diagram illustrating an example method 700 to providesuggested response items in association with an embedded application ina chat conversation.

Suggested response items (also referred to as “suggested items” herein)may be generated and provided in the chat interface and/or the embeddedinterface for selection by a user in a variety of contexts. Suggestedresponse items may be generated and provided to the user automatically,upon consent from the user and one or more other users that sent and/orreceived the image.

Suggested response items can be determined based on one or moretechniques that can provide relevant results to a set of data. In someimplementations, suggested response items can be determined based onstored (e.g., in a look-up table or database), predefined associationsof suggested response items with particular suggestion events and/ortypes of suggestion events that have occurred, as described below.Suggested response items can be or include one or more of differentcontent data types, including text, images, animated images (e.g.,cinemagraphs), audio segments, video, other types of documents (e.g.,spreadsheets, tables, etc.), etc. Suggested response items can alsoinclude or be presented as interactive cards. In some implementations,suggested response items can include attached (e.g., lightweight)embedded applications which perform one or more actions or provideoutput, as described below. Multiple types and suggested responses ofthese types and features can be presented in a menu (e.g., drop downmenu, carousel selection menu, etc.).

In some examples, suggested response items can be determined using oneor more machine learning techniques. In some examples, messagingapplication 103 a/103 b may implement machine learning or interface witha machine-learning application, e.g., a deep learning model, that canenhance user interaction with messaging application 103. Suggestionserver 156, for example, can utilize machine learning to providesuggestions to a messaging application. In some implementations, machinelearning can implemented on one or more other components of theenvironment 100 and, for example, not using suggestion server 156.

A machine learning model can be created, based on training data, priorto receiving a suggestion event for which suggested response items areto be generated, so that upon receiving the indication of an suggestionevent, suggested response items can be generated using the existingmodel. Machine-learning models may be trained using synthetic data ortest data, e.g., data that is automatically generated by a computer,with no use of user information. Synthetic data can be based onsimulated events occurring in embedded applications and embeddedsessions, and responsive commands and messages, where no human users areparticipants. In some implementations, machine-learning models may betrained using sample data or training data, e.g., commands and messagesactually provided by users in response to embedded application andsession events and who consent to provide such data for trainingpurposes. Training data is treated before use to remove user identifiersand other user-related information. In some implementations,machine-learning models may be trained based on sample data for whichpermissions to utilize user data for training have been obtainedexpressly from users. After the machine learning model is trained, anewly-occurring set of data can be input to the model and the model canprovide suggested items based on its training with the sample data.Based on the sample data, the machine-learning model can predictmessages and commands to occurring events in an embedded session, whichmay then be provided as suggested response items. User interaction isenhanced, e.g., by reducing burden on the user to determine a command orcompose a message to an application event, by providing a choice ofresponse items that are customized based on the occurring event and theuser's context. Some examples of machine-learning application andmachine-learning features are described below with reference to FIG. 12.

In some examples, when users provide consent, suggested response itemsmay be customized based on the user's prior activity, e.g., earliermessages provided in a conversation, messages in differentconversations, earlier commands provided by the user to the embeddedapplication or to a different embedded application program, etc. Forexample, such activity may be used to determine an appropriate suggesteditem for the user, e.g., a playful message or command, a formal message,etc. based on the user's interaction style. In another example, when theuser specifies one or more user-preferred languages and/or locales,messaging application 103 a/103 b may generate suggested items in theuser's preferred language. In various examples, suggested items may betext messages, images, multimedia, encoded commands, etc.

In some implementations, machine learning may be implemented on one ormore components of environment 100, e.g., suggestion server 156,messaging server 101, client devices 115, either or both messagingserver 101 and client devices 115, etc. In some implementations, asimple machine learning model may be implemented on client device 115(e.g., to permit operation of the model within memory, storage, andprocessing constraints of client devices) and a complex machine learningmodel may be implemented on messaging server 101, suggestion server 156,and/or a different server. If a user does not provide consent for use ofmachine learning techniques, such techniques are not implemented. Insome implementations, a user may selectively provide consent for machinelearning to be implemented only on a client device 115. In theseimplementations, machine learning may be implemented on client device115, such that updates to a machine learning model or user informationused by the machine learning model are stored or used locally, and arenot shared to other devices such as messaging server 101, servers 135and 150-156, or other client devices 115.

For the users that provide consent to receiving suggestions, e.g., basedon machine-learning techniques, suggestions may be provided by messagingapplication 103. For example, suggestions may include suggestions ofcontent (e.g., movies, books, etc.), schedules (e.g., available time ona user's calendar), events/venues (e.g., restaurants, concerts, etc.),and so on. In some implementations, if users participating in a chatconversation via their devices provide consent to use of conversationdata, suggestions may include suggested message responses to messagesinput by other chat users that are based on conversation content. Forexample, if a first user of two users that have consented to suggestionsbased on conversation content, sends a message “do you want to grab abite? How about Italian?” a response may be suggested to the seconduser, e.g., “@assistant lunch, Italian, table for 2.” In this example,the suggested response includes a bot (identified by the symbol @ andbot handle assistant). If the second user selects this response, anassistant bot is added to the chat conversation and the message is sentto the bot. A response from the bot may then be displayed in theconversation, and either of the two users may send further messages tothe bot. In this example, the assistant bot is not provided access tothe content of the chat conversation, and suggested items are generatedby the messaging application.

In certain implementations, the content of a suggested item may becustomized based on whether a bot is already present in a chatconversation or is able to be incorporated into the chat conversation.For example, if it is determined that a travel bot could be incorporatedinto the messaging application, a suggested message response to aquestion about the cost of plane tickets to France could be “Let's asktravel bot!”

In different implementations, suggestions, e.g., suggested messages asdescribed herein, may include one or more of: text (e.g., “Terrific!”),emoji (e.g., a smiley face, a sleepy face, etc.), images (e.g., photosfrom a user's photo library), text generated based on templates withuser data inserted in a field of the template (e.g., “her number is<Phone Number>” where the field “Phone Number” is filled in based onuser data, if the user provides access to user data), links (e.g.,Uniform Resource Locators), message stickers, etc. In someimplementations, suggested messages may be formatted and/or styled,e.g., using colors, fonts, layout, etc. For example, a suggested messagethat includes a movie recommendation may include descriptive text aboutthe movie, an image from the movie, and a link to buy tickets. Indifferent implementations, suggested messages may be presented asdifferent types of user interface elements, e.g., text boxes,interactive cards, etc.

In various implementations, users are offered control over whether theyreceive suggested items, what types of suggested items they receive, afrequency of the suggested items, etc. For example, users may decline toreceive suggested items altogether, or may choose specific types ofsuggested items, or to receive suggested items only during certain timesof day. In another example, users may choose to receive personalizedsuggested items. In this example, machine learning may be used toprovide suggested items, based on the user's preferences relating to useof their data and use of machine learning techniques.

In block 702, it is checked whether user consent (e.g., user permission)has been obtained to use user data in the implementation of method 700.For example, user data can include messages sent or received by a user,e.g., using messaging application 103, user preferences, user biometricinformation, user characteristics (identity, name, age, gender,profession, etc.), information about a user's social network andcontacts, social and other types of actions and activities, content,ratings, and opinions created or submitted by a user, a user's currentlocation, historical user data, images generated, received, and/oraccessed by a user, videos viewed or shared by a user, etc. One or moreblocks of the methods described herein may use such user data in someimplementations.

If user consent has been obtained from the relevant users for which userdata may be used in the method 700, then in block 704, it is determinedthat the blocks of the methods herein can be implemented with possibleuse of user data as described for those blocks, and the method continuesto block 708. If user consent has not been obtained, it is determined inblock 706 that blocks are to be implemented without use of user data,and the method continues to block 708. In some implementations, if userconsent has not been obtained, blocks are to be implemented without useof user data and with synthetic data and/or generic orpublicly-accessible and publicly-usable data.

In block 708, a (first) embedded application is executed for a firstuser device in association with a (first) messaging applicationproviding a (first) chat conversation, where the first user device isone of multiple user devices participating in the chat conversation andwhich have joined an embedded session created in association with thechat conversation, similarly as described above for FIGS. 2-4. The userdevices are member devices running corresponding embedded applicationsas described above.

In block 710, it is determined whether a suggestion event has occurred,e.g., an event that can cause one or more suggested response items to begenerated as described for FIG. 7. In some implementations, a suggestionevent can include an event that occurs in association with an embeddedapplication. Such suggestion events can occur in an embedded applicationof the embedded session, in the messaging application, in a server usedin the embedded session, and/or in a different application or device incommunication with the embedded session, member devices, or chatdevices. Suggestion events can include reception of user input at adevice, a change in state in a program, communication of data betweendevices, connection of a user device with an embedded session or adevice over the network, reception or transmission of data at a device(e.g., between programs, over a network, etc.), detection of contentfeatures in media data or other data, detection of particular topics inchat messages, one or more of these events occurring at a previous time(e.g., indicated in historical data), etc. For example, in someimplementations, suggestion events can be checked for occurrence in themessaging application (e.g., chat conversation), such as chat usersentering or leaving a chat conversation, particular detected content inchat messages input to the chat conversation by chat users, etc. Otherexamples are described herein. A suggestion event triggers generation ofone or more suggested response items that can be presented on a memberdevice (or chat device) in the chat conversation or chat interface andare selectable for use by the user of the device, as described below.

In various implementations, the embedded application and/or messagingapplication can determine whether an event qualifies as a suggestionevent. In some implementations, a suggestion event can be any ofmultiple predefined types of events in embedded applications, messagingapplications, and/or other applications and devices that have beendesignated to be suggestion events that cause suggested response itemsto be generated for a user.

In some implementations, suggestion events can be determined based onone or more particular events that occur at one or more of the chatdevices that are participating in the chat conversation. For example,such particular events can include user input received by a chatinterface and/or by an embedded interface of the first user deviceand/or of other member devices or chat devices. In some examples, suchparticular events can be chat user actions and/or member user actionsperformed in the embedded application based on the user input receivedby one or more member devices from associated chat user(s) and/or memberuser(s). The first user device (e.g., first messaging application) canreceive indications that particular events have occurred at otherdevices (e.g., member devices, chat devices, and/or other devices),e.g., by receiving data over the network indicating and/or identifyingthe particular events.

For example, a suggestion event can be a user joining or leaving theembedded session based on user input at a member device or chat device,or a different action based on user input and affecting one or morestates of the embedded session (e.g., affecting one or more states ofthe corresponding embedded applications running on the member devicesfor the embedded session). A suggestion event can be an embeddedapplication being selected by a user in the chat interface and/or theembedded application being initiated by a member user. A suggestionevent can be an action performed by a member user in the embeddedapplication (e.g., starting playback of a media item, performing a gameaction, adding or modifying a displayed, shared object provided in theembedded application and displayed in the embedded interface, e.g., adocument object, game object, etc.). A suggestion event can be thecurrent display (e.g., in the embedded interface) of a particular usercomment that was previously added to a media item by a member user(e.g., as described with reference to FIG. 5). A suggestion event can bea change of an item or element in a shared content document based onlocal (first user device) or remote (other member/chat device) userinput, or other shared data being edited in an embedded application ofthe embedded session. A suggestion event can be a selection orconfirmation of a particular travel itinerary by a member user in anembedded travel itinerary application.

In some implementations, suggestion events can be determined based onone or more particular events that are embedded application eventsoccurring at one or more member devices, e.g., within one or moreembedded applications of the embedded session. In some implementations,some types of embedded application events are based on user input, andsome types of embedded application events are not based on user input.In some examples, a suggestion event can be based on an embeddedapplication event such as particular content data (e.g., media itemdata) being played in the embedded application. For example, theparticular content data can be one or more content features (or types ofcontent features) that are detected in visual content (e.g., an image orvideo), or audio content (e.g., an audio segment of data) of a playedmedia item using one or more image recognition and/or voice/audiorecognition techniques. For example, the content features can includevisual content features (e.g., faces if user consent has been obtained,landscape features, monuments, objects, etc.) and audio content features(e.g., voices, particular sound effects, etc.). The content features caninclude geographic locations, e.g., provided as metadata with contentitems such as videos, images, audio segments, games, etc. A suggestionevent can be the attainment of (or failure to attain) a particularobjective or score in an embedded game application, or attainment of ascore difference between a first-place player and the next-place playerin a game that is greater than a predefined threshold. A suggestionevent can be an opportunity for a player to make a particular action ormove in an embedded game application (e.g., a game application waitingon a player action to advance the game state, triggered by a differentmember user having performed a game action, or triggered by time,non-player events in the game, etc.).

In some implementations, suggestion events can be embedded applicationevents of particular types. For example, user member events can includea chat user starting a new embedded session (e.g., by initiating anembedded application at a chat device), a chat user joining an activeembedded session, a member user exiting an active embedded session, orthe last member user of an embedded session exiting embedded sessionand/or otherwise ending an embedded session. Certain designated embeddedapplication events can include starting or ending events, e.g., a gameis won by a member user (causing a game to be completed), a contentdocument is created or deleted, a new video starts or ends within amedia player application, etc. Synchronize events can include events inwhich data is provided to member devices to synchronize the embeddedapplications on the member devices (e.g., an input user action changes agame state, a state is changed of a playback position of a media itemplayed in a media player application, an item on a shared list ischanged, etc.). Suggestion events can be defined to be the occurrence ofone or more of such defined types of embedded application events.

In some implementations, event information can be sent betweenapplications and/or between chat devices to indicate that particularevents (and/or suggestion events) have occurred. For example, eventinformation can be passed from the embedded application to itsassociated messaging application upon occurrence of a particular eventthat has occurred in the embedded application. In some implementationsor cases, the particular event has occurred in the embedded application,and the event information can indicates the occurrence of the particularevent and/or can identify the particular event or the type of the event.For example, the event information can indicate a type of the particularevent (e.g., a game action has been performed in a particular game,playback of a media item has been paused or changed to a differentplayback position, etc.), data associated with the particular event(e.g., time of occurrence of the event, a type of feature beingdisplayed in a played media item that was detected as the event, etc.),circumstances of the particular event (e.g., which member users causedthe event or had a role, status, or score affected by the event, etc.).Such particular events can include any of the events described herein,e.g., embedded application events, messaging application events, serverevents, etc.

In some implementations, event information can be sent from one deviceto another device over the network, e.g., from a member device (or chatdevice) to a server device, from a server device to one or more memberdevices (or chat devices), etc. For example, embedded event informationcan be from an embedded application indicating an event occurring in theembedded application, server event information can be from a serverindicating an event occurring at the server, etc. In some examples, themessaging application on a member device can receive event informationfrom a different device that indicates a particular event has occurredon a different device. In some implementations or cases, the messagingapplication can determine if an event indicated by the received eventinformation is a suggestion event. In some implementations or cases, themessaging application can pass the event information to an embeddedapplication executing in association with that messaging application,where the embedded application determines if the event indicated by theevent information is a suggestion event (and can communicate anyresulting suggestion event back to the messaging application).

In some implementations, event information received by the messagingapplication can indicate that the particular event is a suggested event.For example, the source of the event information may have determinedthat the particular event qualifies as a suggestion event. In someimplementations, the event information can indicate the particular eventand the messaging application can determine whether the particular eventqualifies as a suggestion event. In some implementations, the messagingapplication can use such event information to obtain suggested items,e.g., determine one or more suggested items itself and/or send the eventinformation (or a request derived from the event information) to adifferent program or device to determine suggested items which can besent back to the messaging application.

In some implementations, suggestion events can be particular events inor provided to the messaging application. For example, a user entering(e.g., logging on, going online) or exiting the chat conversation can bea suggestion event. One or more particular chat messages input by memberusers in the chat conversation (or a particular set or sequence of chatmessages) can be considered a suggestion event. For example, chatmessages can be parsed and one or more predetermined topics, words orkeywords, and/or phrases can be detected to determine a suggestion event(e.g., “go out to eat,” “let's invite User4,” “let's watch MovieA,” aparticular name, address, location, etc.). In some implementations, amachine learning model can be trained in a training stage with syntheticor actual training data and, in an inference stage used in method 700,can be used to process a set of chat messages to predict if a suggestionevent has occurred. For example, the model can predict if any particularuser actions (e.g., commands or further messages) are likely to beinitiated or provided by users based on the content of the set of chatmessages, and if such commands are within a threshold probability ofoccurrence, the input of the set of chat messages (e.g., the input ofthe last chat message of the set) can be considered a suggestion event.

In some implementations, suggestion events can be particular events inor provided to the messaging application that change one or more statesof an embedded application executing on the first device (e.g., which inturn causes a change in one or more states of the corresponding embeddedapplications executing on the other member devices). For example, userinput provided to the messaging application via the chat interface candirect commands to the embedded application (e.g., change playback stateof a playing media item, perform a game action, etc., based on textcommands input as chat messages in the chat interface). In someimplementations, input in the chat interface that are not directcommands to the embedded application can change one or more states ofthe embedded application. For example, a selection of options for anembedded application may be performed via a menu or interface elementsdisplayed in the chat interface external to the embedded interface. Inadditional examples, chat messages input in the chat interface may beparsed by an executing embedded application and may cause the embeddedapplication to change one or more of its states to determine or processdata, display particular output data, and/or retrieve data from storage,a different device, a network site, etc., as examples described herein.

In some implementations, a suggestion event can be a particular eventoccurring within a different chat conversation provided by the messagingapplication that provides the first chat conversation. For example, theparticular event can be a user message input in the different chatconversation, particular content of that user message matchingpredefined words or phrases (or other matches based on machine learningtechniques), a user joining or exiting the different chat conversation,etc. In some examples, a chat user of a different chat conversation caninput a message indicating interest in joining the first chatconversation, and this message can be detected as a suggestion event togenerate a suggested command (e.g., a command to add the users of thedifferent chat conversation to the first chat conversation and/or to theembedded session) or suggested message (e.g., a message to be output inthe different chat conversation that greets the other users, invites theusers of the different chat conversation to the first chat conversation,etc.).

In some implementations, a suggestion event can be a particular eventthat is a user action (e.g., input command) instructing the system togenerate one or more suggested response items for the user. For example,the user can select an interface element in the embedded interface orthe chat interface that is a command to generate one or more generalsuggested messages or suggested commands. In some examples, suchsuggested messages can include comments about the embedded applicationor comments about one or more member users, or such suggested commandscan include commands to exit an embedded session, resign a game, etc.

In some implementations, a suggestion event can be based on receiveddata from a different application executing on the user device that isdifferent than the messaging application and embedded application, wherethe data indicates a particular event has occurred in the differentapplication. For example, a videoconference application can send anindication (e.g., data) to the messaging application indicating that thevideoconference has ended, a particular user has joined or exited thevideoconference, etc. In some implementations, a suggestion event can bea particular event that has occurred on a server or other device (e.g.,in an application executing on the server or other device) that is incommunication with the user device over the network and, e.g., isproviding data used in the embedded session. For example, the particularevent can include user input (e.g., comments or ratings for stored mediaitems) the server has obtained from other user devices not participatingin the chat conversation, e.g., user requests for second content datathe same as first content data the server is providing to the embeddedsession, user comments or ratings for the second content data that isbeing sent to the other user devices, etc.

A suggestion event can include a particular event occurring on theserver, e.g., a game event (such as a change in game state, etc.) in agame executed by the server and streamed to member devices over thenetwork, a particular type of content feature being displayed in a mediaitem being streamed to member devices from the server, etc. Themessaging application can receive server event information from theserver that indicates or describes the particular server event that hasoccurred, which can qualify as a suggestion event for the messagingapplication or embedded application.

A suggestion event can include a particular event that occurred at aprevious time, if user consent has been obtained. For example, theoccurrence of one or more of the particular events described herein canbe indicated or described in data stored on one or more devices, withuser consent (e.g., a description of device communication, content ofchat messages, etc.), and a device can search for such previousparticular events in this data.

In block 712, it is determined whether the detected suggestion event isan event (and/or has a type) that is associated with one or moresuggested commands for the embedded application. For example, some typesof suggestion events can cause generation of suggested response itemsthat are suggested commands for the embedded application.

A suggested command for an embedded application can be, for example, acommand to modify one or more states of the embedded application. Forexample, the suggested command can be a suggested playback command toset a playback position or change a current playback position to a newplayback position of a media item that is being played in the embeddedapplication. In further examples, a suggested command can be a commandto modify a game state in an embedded game application, e.g., perform aparticular game action such as move a game piece or character, change agame display viewpoint, select a game object, etc. A suggested commandcan be to add, modify or remove a particular item or element of a sharedcontent document (e.g., shared list) provided in the embeddedapplication. Suggestion event types that can provide suggested commandscan include, for example, a joining or exiting of one or more memberusers to or from the embedded session, an action made by a player in agame embedded application, a state of a game in which the game iswaiting for an action or move from a player, an event in which a playeror player's objects in a game are being interacted with by a differentplayer or player's objects (e.g., an attack or conflict between objects,an offer or request for help from one player to another player, etc.), adetected change in visual or audio content of a media item (e.g., achange from a scene with low movement of objects to a scene havingmoving objects over a threshold movement speed, a change from a talkingscene to an action scene, a change of audio output from lower volume orconstant sound to a higher volume over a threshold or sound ofrapidly-changing amplitude over a threshold frequency, etc.), a changeperformed to a shared content document by a different member user (e.g.,a suggestion to prompt the user for additional changes or to change backthe performed change), a change in the playback position of a playedmedia item, etc.

If the detected suggestion event is of a type that provides one or moresuggested commands for the embedded application, then the methodcontinues to block 714, in which one or more suggested commands areobtained and are based, at least in part, on the suggestion event. Insome implementations, suggested commands can be based on other factorsin addition to or alternative to the suggestion event, e.g., one or morecurrent state(s) of the embedded application and/or messagingapplication (e.g., current time position of playback in a media item,current game score, current number or identifications of the memberusers and/or chat users, time of day, etc.). In some examples, the oneor more suggested response items may be determined by the embeddedapplication and/or the chat application based on the suggestion event.In some implementations, a user may be provided an option (e.g.,displayed interface element) that causes suggested response items to bedisabled, e.g., not generated and/or not displayed.

In some implementations, the suggested commands can be determined basedon stored, predefined associations of suggested commands with particularsuggestion events and/or types of suggestion events. For example, one ormore particular types of suggestion events may be associated with one ormore particular commands, e.g., in a look-up table or database, suchthat the associated commands are retrieved based on the detectedsuggestion event.

In some implementations, the embedded application may implement arecommendation engine (e.g., based on rules used in determining outcomesin the embedded application, other rule sets, decision trees, etc.) todetermine the suggested response items. In one example, the suggestedresponse items may be determined based on a decision tree (or otherdecision construct) in which the states of one or more conditions atnodes of the tree determine the path through the tree to determinesuggestion items as end results, where the conditions can includesuggestion events and other conditions. In another example, when theembedded application is a rules-based game (e.g., chess, poker, etc.),the suggested response items may be determined based on rules and/orobjectives of the game. For example, the suggested response item may bea move (e.g., Bg7, which indicates a movement of a bishop to chess boardlocation g7) in the game. For example, the ruleset or decision tree maydetermine the move based on predetermined probabilities of winning. Inanother example, when users permit analysis of user data, the suggestedresponse item may be based on the user's prior accepted suggestions(e.g., the user normally opens a chess game with the move d4, indicatingmoving the pawn to location d4).

In some implementations, when user permits use of user profile data, thesuggested response items may be determined based on user profile data,e.g., user preferences or defaults directly specified by user inputand/or inferred based on previous user actions. For example, if theembedded application is a shopping application (e.g., travel app,e-commerce app, etc.), and the suggestion event is that the user hasnavigated to a “purchase” user interface, the suggested response itemsmay include “pay with credit card,” “pay with bank account,” “pay withcash,” etc. based on the user's profile. Similarly, if user consent hasbeen obtained, other user profile data such as a user's contactinformation (e.g., address, phone number, email, etc.) may be includedin the suggested response items. In some implementations, e.g., when theembedded application is a “quiz” application, the embedded applicationmay provide suggested response items as the multiple choices to answer aquiz question.

In some implementations, suggested commands can be determined using atrained model for the embedded application and/or machine learningtechniques as described herein. For example, suggested commands can be aresult of an inference stage of the machine-learning model, where themodel has been previously trained with particular suggestion events andtypes of suggestion events and with particular commands input by usersin response to those suggestion events as training data, such that themodel can produce likely or relevant suggested commands at the inferencestage based on a newly-occurring suggestion event. In someimplementations, the suggested response items may be determined by amachine-learning application that is trained to provide response itemsfor the specific embedded application. In some examples, a machinelearning model used for suggested responses can be trained to recognizevarious game actions that can be performed in a particular embeddedapplication, where the machine learning model can provide suggestedcommands in the embedded application that triggers a responsive actionin that embedded application, e.g., “build a tower”, “move pawn to spaceD1”, “play this video next”, etc.

In various implementations, the suggestion event may be analyzed todetermine the one or more suggested commands (or other response items).In some implementations, analysis of the suggestion event may includelooking up a rule set or decision tree for the suggestion event. In someimplementations, analysis of the suggestion event may includedetermining a state of the embedded application (e.g., a progress levelin a game, a user setting related to assistance during a game, etc.) todetermine context of the suggestion event.

In some example implementations, the embedded application is playing amedia item, and the suggested commands can be provided to modify theplaying of the media item. For example, if the suggestion event is achat user joining the embedded session to view the media item, then asuggested command can be to restart the playback from the start of themedia item (e.g., start a video or audio segment from the beginning ofthe segment), which can allow the new member user to view the media itemfrom the beginning. In some implementations, such a “restart” suggestedcommand can be generated in response to the media item being at acurrent playback point that is a threshold time period after its start,such that the restart suggested command is not generated if the playbackposition has been playing for a time period more than the threshold timeperiod (e.g., since the existing member users may not wish to restart amedia item that has been playing for a long time). In another example,if the suggestion event is a particular detected type of scene orsequence (e.g., a detected action scene or sequence) that has beendetected to have occurred in the media item, suggested commands caninclude rewinding the playback position a particular amount of time toreplay the detected scene or sequence from the start of that scene.Another example suggested command can cause the embedded application todisplay a prompt or input field to allow the user to input a usercomment that is then displayed (e.g., superimposed) on the displayedscene of the played media item (e.g., as described with reference toFIG. 5). In another example, if the suggestion event is a change in theplayback position of the media item by another member user, a suggestedcommand can be to undo or revert the change in the playback position tothe position it held prior to the change. In another example, if thesuggestion event is a change in the playback position, the suggestedcommands can include one or more further changes in the playbackposition to the nearest (in one direction or either direction) scenetransition, chapter division, segment division, or other marked divisionin the media file (e.g., commands such as, “adjust to nearest previouschapter heading?” and “adjust to nearest later chapter heading?”). Inanother example, if the suggestion event is a change in the audio volumeoutput by the media item (e.g., by a threshold amount, or to a volumelevel above a threshold level), suggested commands can be to raise orlower the volume.

In some example implementations, the embedded application is providing agame, and the suggested commands can be directed to the game. Forexample, if the suggestion event is a game action by a second player ofthe game, a suggested command for the first player can cause input ofone or more possible actions to the game in response to the game action,e.g., as determined by game algorithms that can evaluate game strategyand actions. In some examples, if the suggestion event is a move of agame piece by an opponent player, the suggested commands can includevarious possible responding moves of the user's pieces in the game(e.g., in an asynchronous or turn-based game). In another example, ifthe suggestion event is an invasion of a user's game territory by enemygame pieces, the suggested commands can include commands to move piecesto intercept invaders, defend an invaded location with a player's piecesat the invaded location, etc. In another example, if the suggestionevent is another player joining the game, suggested commands can includerequesting the new player to join the user's team in the game, andrequesting a different player to form a team against the new player. Inanother example, if the suggestion event is a member user exiting thegame (or changing of a player role to an observer role in the game), asuggested command can be to request that the game be paused until areplacement player joins the game. In another example, if the suggestionevent is the user's score (or other game objective) differing from(e.g., trailing or leading) other players' scores or objectives by athreshold amount, suggested commands can include sending hints to otherplayers or requesting other players to provide hints to the user,requesting other players to handicap or boost themselves in the game,restarting the game, etc.

In some example implementations, the embedded application is providing ashared object, e.g., a game object in a game, a shared content documentsuch as a list or other document of items, etc. Suggested commands canbe commands to change or affect the shared object, e.g., edit, remove,etc. the shared object, change one or more of its characteristics (e.g.,type, color, size or dimensions, etc.). For example, if the suggestionevent is the initiation of a shared list in the embedded application, asuggested command can be to add, delete, or change an item on the list.In another example, if the suggestion event is the addition of an itemto the shared list by a different member user, a suggested command canbe to highlight or otherwise graphically indicate the added item in theembedded interface. In some implementations, the highlighting commandcan be accompanied by suggested text that can be output in the embeddedinterface or in the chat interface, e.g., “do we need this item?” or “Isuggest removing this” (e.g., a suggested message as described below).In another example, if the suggestion event is removal of an item, asuggested command can include outputting text in the embedded interface(or chat interface), e.g., “why did you remove that?” In anotherexample, in response to a suggestion event of highlighting a particularitem by the user, suggested commands can include moving the suggesteditem within the list one, two, or more places, up or down, to thebeginning or end, etc.

In additional examples that can be applied to many types of embeddedapplications, if the suggestion event is a member user joining theembedded session, a suggested command can instruct that control overspecified functions of the embedded application be assigned to the newmember user, if the new member user has been assigned a user status(e.g., user role) in the embedded application that allows such assigningof control. For example, the suggested command can be to allow the newuser a status able to change a playback position of a media item playedin the embedded application, change items on a shared list, etc. In someimplementations, a suggested command can be to remove such controlabilities from a designated user (if the commanding user is able to doso), e.g., if abusive or inappropriate language has been detected by themessaging application (or other program or device) in messages from thedesignated user in the chat conversation.

Suggested commands can, if user consent has been obtained, also oralternatively be based on a history of prior actions and/or messagesperformed by the user in the same or similar types of embeddedapplications and/or for same or similar types of output data (e.g.,media items, games, etc.). For example, if the user has previouslyrewound or skipped the playback of a particular scene or type of scenein a video, a suggested command can be generated which causes theplayback position of a currently playing media item to be rewound ormoved in the same manner.

Suggested commands can also or alternatively be based on member userinput in the (first) chat conversation, as displayed in the chatinterface of the messaging application. In various implementations, thisuser input can considered part of the detected suggestion event, or canbe considered external to (e.g., supplementary to) the detectedsuggestion event. For example, a suggested command can be generated toinitiate an embedded session involving an embedded application thatimplements a media player, a game, a content document, or otherfunctions, based on chat messages that mention such an activity (e.g.,“let's watch Funny Movie 2,” “let's play Chess,” or “we need a shoppinglist”, etc.). In another example, a suggested command can be generatedto assign a user status or role to a particular member user in theembedded session if that member user has sent a message in the chatconversation indicating a desired user role (e.g., “I'll play” toindicate a player role, or “I only want to watch” to indicate anobserver role). In another example, a suggested command can be generatedthat moves a playback position for a played media item past a currentscene or to a particular later scene if one or more member users haveinput messages in the chat conversation such as, “let's skip this scene”or “let's watch the car chase.”

In some implementations, user data can be used to determine suggestedcommands and/or suggested messages, if consent to use such user data hasbeen obtained from the user(s) related to or associated with such userdata. For example, the current geographic locations of member users orchat users (or their devices) can be obtained by the messagingapplication and/or provided to the embedded application for use indetermining suggested response items. For example, suggested commandscan refer to the current geographic locations of users (with userconsent), e.g., to instruct an embedded travel itinerary application toprovide an itinerary based on current user location. Other types of userdata can cause generation of suggested items, if user consent has beenobtained. In additional examples, user data such as a list ofapplications installed on the device (e.g., applications external to themessaging application) can be used to generate suggested items. Forexample, suggested messages can be generated that recommend one or moreapplications for use by other chat users in the chat conversation.

In additional examples, user data such as SMS messages and phone callsreceived by the user device can be used to generate suggested commandsto forward or annotate messages. For example, the messaging applicationintercepts that an SMS message has been received and can generateforwarding or annotation capabilities, e.g., a suggested command and/orsuggested message to share that SMS message with the chat conversation,a suggested command to annotate an SMS image to another message (e.g.,chat message, email message, etc.) and send it to another user, etc. Inanother example, the messaging application can detect that a phone callis being received while a user is actively inputting messages in thechat conversation, and the embedded application can generate suggestedmessages to the chat conversation (e.g., “I'm answering a phone call,will be back”). User data such as fitness tracker information can beused to provide suggested messages that challenge other chat users inthe chat conversation to fitness exercises. User data such as currentsystem audio volume/mute state on the user device can be used to providesuggested commands that automatically adjust media playbackvolume/on-off state before or during playback of the media item. Userdata such as browsing history can be used to generate suggested commandsto display shopping suggestions for the user, e.g., in a browserembedded application. User data such as user account information (e.g.,login/password) to particular systems or network sites can be used toprovide suggested commands that access those systems in an embeddedapplication. User data such as recently-added users to a contact list(e.g., added within a threshold amount of time from the current time)can be used to provide a suggested command to add one or more of thoseusers to the chat conversation or a suggested command to invite one ormore of those users to join a particular embedded session in which theuser is participating.

In some implementations, suggested commands can be to the embeddedapplication to cause the embedded application control an externalapplication executing on the first user device or on a different devicein communication with the first user device over the network. Someexamples of such control are described herein.

Some suggestion event types can cause generation of both suggestedcommands from blocks 714-718 and suggested messages from blocks 722-724.In some implementations, suggested command items that provide suggestedcommands can be visually distinguished from suggested message items thatprovide suggested messages to be output in the chat interface. Forexample, different colors or highlighting can be used for these types ofsuggested response items to assist a user in distinguishing thedifferent types of suggested response items.

In some implementations, a plurality of suggested commands can begenerated and can be ranked based on one or more predetermined criteria.For example, a ranking score for a suggested command can be based on howlikely the suggested command is to be selected in response to thedetected suggestion event, e.g., as indicated by the machine learningmodel and its training based on synthetic or actual data of priorcommands provided in response to prior suggestion events. In someimplementations, suggested responses can be provided with confidenceratings or rankings which indicate how likely that the suggestedresponse will be selected by the user. For example, such confidenceratings can be based on prior selections by the user (or multiple users)of suggested responses provided for the same or similar suggestionevents, if consent from such users has been obtained. In someimplementations in which machine learning models are used, the suggestedresponses may have rankings indicating which responses are most likelyto be selected as determined based on the training of the model. Aparticular number of top-ranked suggested commands can be selected foroutput on a user device. In some implementations, suggested responsescan be displayed in order of their ranking or confidence rating. In anexample, a suggested response having a high confidence rating (e.g.,over a threshold rating, or within a threshold number of top ratings)may be selected by user input as a command or message that triggers anaction in an associated embedded application. In some implementations,after the high-confidence suggested response is generated and before itis selected by user input, the associated embedded application can bepre-loaded (e.g., downloaded in the background and stored in localstorage) to the user device and its code initiated. This allows aninstant display of output from the embedded application on the userdevice after the high-confidence suggested response is selected by userinput. Such pre-loading of embedded applications can be omitted forlower-confidence (e.g., below threshold) suggested responses since theyare less likely to be selected.

In some implementations in which multiple embedded applications can besimultaneously executing for the first user device as described above,one or more suggested commands can be commands provided to multiple ordifferent executing embedded applications.

In some implementations, one or more of the suggested commands can becommands to the messaging application. For example, a suggested commandcan include a command to the messaging application to add one or moreparticular chat users to the embedded session, where the particular chatusers are specified in the suggested command. For example, such asuggested command can be generated based on a suggestion event that isdetected to have occurred by the messaging application (or embeddedapplication) based on one or more chat messages being input by the firstuser and/or other member user of the member session (e.g., “let's askKenny if he wants to join”, etc.), or by one or more chat messages inputby chat users that are not member users (e.g., “maybe we should jointhat movie”). The suggested command can be presented to a member user,and/or to a chat user who is not a member user. In some implementations,to determine such a suggestion event, particular chat user names, memberuser names, names of content data, general words relating to an embeddedsession (e.g., “movie,” “game,” etc.) and other words can be detected inchat messages in conjunction with predefined keywords and key phrases,and/or parsing and analysis of chat messages via machine learningtechniques. In some implementations, the suggestion event can also oralternatively be a detection by the messaging application that a contentitem (e.g., a played media item, a game, a content document, etc.)provided in the embedded session (a first embedded session) is the sameas a content item being provided to other chat users in a secondembedded session concurrently with the display of the content data inthe first embedded session. This can cause the messaging application togenerate a suggested command to add the member users of the secondembedded session to the first embedded session. User comments associatedwith the content item by chat users outside the embedded session canalso be a basis for a suggestion event similarly as described below.

In some implementations, a suggested command to the messagingapplication can include a command to add a user to the chat conversationof block 708 (e.g., first chat conversation), or add the user to thefirst chat conversation and the embedded session of block 708 (e.g., thefirst embedded session). For example, the suggested command can instructthat an external user who is currently not participating in the firstchat conversation be added. Such a command, when executed, causes theexternal users' devices to join the chat conversation. In some examples,the external user can be participating in a different chat conversationthat is provided by the first messaging application or provided by adifferent messaging application in communication with the firstmessaging application. In some cases, one or more member users of thefirst embedded session may be participating in the different chatconversation simultaneously with participating in the first embeddedsession and the first chat conversation, and such member users can beprovided the suggested command (e.g., in blocks 716 and 718) to add oneor more external users from the different chat conversation. Forexample, such a suggested command can be generated based on a suggestionevent that is detected to have occurred by the messaging application (orembedded application) based on one or more chat messages being input byone or more chat users of the first chat conversation (similarly asdescribed above) and/or by one or more external users of the differentchat conversation.

In some implementations, a suggestion event can also or alternatively bea detection by the messaging application that a content item (e.g., aplayed media item, a game, a content document, etc.) provided in theembedded session is the same as an external content item concurrentlybeing provided to the external users. This causes the messagingapplication to suggest to add the external users to the first chatconversation. In some implementations, the suggested command can be toadd the external users to the first embedded session. In some examples,the suggestion event can be triggered if a current playback position ofthe content item output by the embedded application is within athreshold amount (of time, data, etc.) of a current playback position ofthe external content item output to the external users. In someimplementations, a suggestion event can also or alternatively be adetection by the messaging application that one or more user commentshave been input by one or more external users associated with anexternal content item being output to the external users, and theexternal content item is the same as a content item being output by theembedded application. In some examples, a suggestion event can be adetection of a particular type of user comment by the external users,e.g., approval ratings by users for the content data, a reference to oneor more of the member users of the first embedded session, etc. Suchuser comments can cause the messaging application to generate asuggested command to add such external users to the first embeddedsession (as member users) and/or first chat conversation (as chatusers).

In some implementations, if user consent from the relevant users hasbeen obtained, user data can be used to determine a suggestion eventcausing generation of a suggested command to the messaging application(or other application) to add one or more users (e.g., chat users orexternal users) to the embedded session or to the chat conversation asdescribed above. For example, user data (e.g., accessible database dataor contact list data) can indicate particular users that have one ormore particular social relationships with one or more member users (orchat users), and such particular users can be selected to be included ina suggested command to add these users to the embedded session or chatconversation. For example, such particular social relationships caninclude users that are in the contact lists of member/chat users, usersthat are in user groups created by member/chat users (e.g., socialnetworking user groups), users within a particular degree of separationfrom member/chat users, etc.

In some implementations, one or more of the suggested commands can becommands to the first user device to perform one or more tasks externalto the messaging application. For example, the tasks can include openingand executing an application external to the messaging application onthe first user device, and/or controlling an external applicationexecuting on a remote device in communication with the first userdevice. For example, such an application can include a web browserapplication, a communication application, a calendar application, a wordprocessing application, a specific application to access a particularInternet service, etc. If the external application is executing on thefirst user device, it can provide display output on the first userdevice. The display output can include, for example, informationreceived from a server device in communication with the first userdevice. In some examples, a suggested command can include a command toopen a web browser application, display a user interface of the webbrowser application on the first user device, instruct the web browserapplication to access a web page at a particular link, and display thecontents of a web page at the particular link in the user interface ofthe web browser. Use of appropriate communication protocols can beincluded (e.g., websockets). The particular link can be a linkdetermined based on the suggestion event. In another example, the openedapplication can be a shopping application that outputs data receivedfrom a server indicating an item or service to purchase and providingone or more controls receptive to user input to purchase the item orservice, where the item or service is related to the suggestion event.

In some examples, the command can instruct an application to open orinitiate on the first user device to display information related to oneor more content features included in a content item that is displayed inthe embedded interface on the first user device. For example, asuggested command to open or execute an application can be generatedbased on a suggestion event that is detected to have occurred by themessaging application (or embedded application) based on the output dataof the embedded session and/or based on one or more chat messages beinginput by one or more chat users of the first chat conversation,similarly as described above. In some examples, if user consent has beenobtained, content features including visual features (e.g., faces,animals, landscape features, objects, etc. using image recognitiontechniques), audio features (speech, types of sounds, etc. using audiorecognition techniques), or topics (e.g., a subject of a presentation,geographical location of an image or a scene in a video, etc.) can bedetected by a system in output data of the embedded application andsimilar content features can be searched for on accessible sites anddatabases over the network. For example, if a chat message from a memberuser includes “I like that coat she's wearing” and the embeddedapplication is displaying output data of a video or image depicting aperson with a coat, this combination of the chat message related to thevisual feature displayed in the embedded application output can be asuggestion event. This causes the messaging application or embeddedapplication to search for similar coat items in accessible web pages orshopping sites over the network, e.g., by using an image search or textlabels determined from one or more image recognition techniques. One ormore network sites having matching items can be included in one or moresuggested commands. For example, a suggested command can be generatedfor one or more member users, where the suggested command (if selected)instructs the first user device to open a browser application thatdisplays one of the matched coat items. In some examples, the suggestedcommand can be displayed as a text description of the action(s) itcommands, e.g., “Display a website showing the coat.”

In other examples, a suggestion event can be detected when the embeddedapplication displays a person giving a lecture, where an identity of theperson can be determined (e.g., in metadata of the output data, bydetecting a subtitle for the speaker, etc.), and items related to thespeaker are searched for and found in content items accessible over thenetwork. In one example, a book written by the speaker is found on awebsite. A suggested command can be generated for one or more memberusers, where the suggested command (if selected) instructs the firstuser device to open a shopping application that displays a descriptionof the book with a selectable option (e.g., displayed element) topurchase the book by the user.

In additional examples, suggested commands can be determined based onone or more images, videos, audio data segments, or other types ofcontent data. For example, a number of images (e.g., representations ofmedia items, items to purchase, etc.) can be displayed in an embeddedapplication, and a suggested command can be to select one or more of theimages, where the suggested command is determined based on previousimages selected by the user. In another example, a suggested command canbe to select a particular color of a clothing item from a list ofmultiple colors of that clothing item, where the suggestion is based onprevious user selections (e.g., where the user previously selected aparticular color more frequently than other colors).

In additional examples, a suggestion event can be a user joining a chatconversation, triggering generation of a suggested command in thejoining user's chat interface to launch a “discovery embeddedapplication” that (with consent of the chat users) stores and displays,in the chat interface or embedded interface, a history of actions takenand/or content output in the embedded session by the chat users prior towhen the joining user joined the chat conversation. For example, thehistory can include identifications of other embedded applications thathave previously been used in the chat conversation (including whichembedded sessions are currently ongoing, ongoing shared lists, etc.). Insome implementations, the embedded application can display a launch/joincontrol for each of these other embedded applications that initiates theassociated other embedded application, allowing the joining user tore-initiate a previous embedded session, join/continue a previousembedded session if it is ongoing, etc. This can allow a new user todiscover and catch up on the activities that the group of users in thechat conversation has been doing prior to the new user joining the chatconversation.

In additional examples, a suggestion event can be an externalapplication (e.g., executing on the first user device or a remotedevice) sending data to the messaging application while a chatconversation is active (e.g., the data can be an indication of anoccurrence of an event in a communication application, calendarapplication, etc.), and a suggested item can be displayed in the chatinterface providing a suggested command or suggested message (see below)based on the data (e.g., a suggested command to save the data indicatingthe event in storage for later review by the user, and/or a suggestedmessage describing the event in text form, which can be selected to beoutput in the chat conversation). A suggestion event can be a userchanging the group information for the chat conversation (e.g., a visualbackground displayed in the chat interface (wallpaper), chatconversation name or group name, group icon, etc.), and this can triggera suggestion command to initiate an image editing embedded applicationthat provides controls to the chat users that can create a newwallpaper, e.g., by editing an image in a shared editing interface withthe other chat members.

In some implementations, recommendations can be generated in block 714instead of or in addition to the suggested commands. For example, such arecommendation can describe a particular action that is suggested forthe user, but does not initiate a command to cause that action to beperformed if the recommendation is selected by the user. Thus, the userwould perform the recommended action manually if the user chose tofollow the recommendation.

In some implementations, as in the example of FIG. 7, suggested commandscan be determined by the embedded application and displayed by theembedded application, e.g., in the embedded interface and/or provided tothe messaging application to be displayed in the chat interface. In someimplementations, other components of the system can determine suggestedcommands. For example, the messaging application can determine suggestedcommands based on, e.g., events in the chat interface and/or based onevent information from the embedded application. In someimplementations, a server (e.g., messaging server, suggestion server,etc.) can be provided event information and can determine suggestedcommands. For example, the messaging application can send descriptiveinformation indicating the suggestion event to a server, and the servercan determine one or more suggested commands that are provided back tothe messaging application.

In some implementations, e.g., when the embedded application does notinclude suggestion features, the messaging application may provide thesuggested response items. For example, if the embedded application is animage-viewer application, the messaging application may provide asuggested command to enhance the image, to download the image, toexecute an image search for the image, etc. In some implementations, thesuggested commands may be provided by both the embedded application andthe chat application. The method continues to block 716.

In block 716, the one or more suggested commands determined in block 714are provided from the embedded application to the messaging application(if the embedded application generated the suggested commands) on thefirst user device. In some implementations, the embedded application cansend data to the messaging application from which the messagingapplication can determine one or more suggested commands, instead of orin addition to sending suggested commands to the messaging application.For example, the embedded application can send data describing thesuggestion event (e.g., an indication of a user action in the embeddedapplication, a game score, an indication of success or failure achievinga game objective, etc.), and/or can send data providing a context to thesuggestion event (e.g., video data, audio data, states of a game,portions of a shared list, etc.). In some implementations, the messagingapplication can determine suggested commands from this data, and/or cansend the data to a suggestion engine, e.g., suggestion server 156, todetermine and send back suggested commands based on the data to themessaging application. The method continues to block 718.

In block 718, the messaging application outputs the suggested commandsin the chat interface (and/or the embedded application outputs thesuggested commands in the embedded interface) for selection, such thatthe first device displays the suggested commands. In someimplementations, the suggested commands can be each displayed as adescription of the actions that the suggested command instructs (e.g.,“Skip this scene,” “Move pawn 3 forward,” “add User4 to this moviesession”, “Display option to purchase a coat”, etc.). For example, thesuggested commands can be displayed in a list in the chat interface, asselectable messages from a bot, etc. The individual suggested commandscan be selectable by the user, e.g., via touchscreen input or other userinput. In some implementations, the suggested commands can be displayedas interface elements in the chat interface, e.g., as buttons, in adrop-down menu, etc. Some implementations can display the suggestedcommands in a persistent area of the chat interface so that the commandsdo not scroll off the display screen when additional chat messages aredisplayed in the chat interface. In some implementations, the suggestedcommands are not displayed to the other chat users of the chatconversation and the member users of the embedded session, e.g., thecommands are specific to the first user of the first device. In someimplementations, one or more of the suggested commands can be displayedin the chat conversation to all chat devices or member devices, or to asubset of the chat devices or member devices which may have been foundrelevant to the suggested commands. In some implementations, if one userselects a suggested command, that command is removed from the suggestedlist of the chat interfaces of all the chat devices.

In some implementations, the suggested commands can have a limiteddisplay time before automatically being removed from the chat interfaceby the messaging application. For example, a predefined time limit canbe used, such that the suggested commands are removed after the timelimit expires. In some implementations, the suggested commands can beremoved based on one or more conditions being met. For example, if asuggestion event or application state caused particular suggestedcommand(s) to be determined and displayed, and that suggestion event orapplication state is no longer relevant, pending, or valid, then thoseparticular suggested command(s) can be removed from the chat interface.In some examples, if suggested commands present actions in a gameresponding to another player's action, and the user performs a differentaction, then those suggested commands are no longer relevant and can beremoved. In another example, if an event in a played media item is nolonger being displayed, e.g., after a predefined amount of time, thensuggested commands reacting to that event can be removed. In someexamples, the embedded application can inform the messaging applicationof new events and states and/or when suggestion events are no longervalid or pending, such that the messaging application can determine whento remove suggested commands from display. The method continues to block720, described below.

If the suggestion event type does not provide suggested commands asdetermined in block 712, or after block 718, the method continues toblock 720, where it is determined whether the detected suggestion eventis an event (e.g., has an event type) that is associated with one ormore suggested messages for the chat conversation. For example, sometypes of suggestion events can provide suggested response items thatinclude suggested messages to be output in the chat conversation. Asuggested message can be, for example, a text message that is displayedin the chat interface as if the selecting user has input the message asa chat conversation message. In some implementations, suggestion eventtypes that can provide suggested messages can include one or more of thetypes of suggested events that can provide suggested commands asdescribed above. In some examples, suggestion event types that canprovide suggested messages can include the event examples describedabove for suggested commands. In some implementations, some types ofsuggestion events can be designated as providing one or more suggestedmessages and not providing one or more suggested commands, andvice-versa.

If the detected suggestion event is of a type that provides one or moresuggested messages for the chat conversation, then the method continuesto block 722, in which one or more suggested messages are obtained basedon the suggestion event and/or other conditions. For example, similarlyas described for suggested commands (e.g., block 714), the messagingapplication can determine one or more suggested messages, and/or cansend descriptive data to a suggestion server (or other server) whichdetermines and sends back one or more suggested messages to themessaging application, etc. In some implementations, the embeddedapplication can determine one or more suggested messages.

In some implementations, the suggested messages can be determined basedon stored, predefined associations of suggested messages with particularsuggestion events and/or types of suggestion events, determined using arecommendation engine, determined using a trained model and machinelearning techniques, and/or determined using other techniques andfeatures similarly as described herein for suggested commands, e.g., asdescribed for block 714.

In some examples, a suggested message can be a description of thesuggestion event that caused the suggested message, or a description ofan action that caused the suggestion event. For example, if the firstuser performs an action in the embedded application that is detected asa suggestion event (e.g., a game action in a game, setting a playbackposition in a media player application, etc.), the embedded applicationcan provide a suggested message (or provide an indication of the eventto the messaging application that provides a suggested message) thatdescribes the action. For example, the suggested message can describethe action performed by the user as “User1 has skipped past the currentscene” or “User1 has moved a knight.” If the suggested message isselected by the first user (e.g., in block 730 below), the suggestedmessage is output to the chat conversation, e.g., to share the useraction with the embedded session and/or the chat conversation.

In some implementations, if the suggestion event is a user action thatinstructs the system to generate one or more message suggestions aboutthe embedded application and/or embedded session, then various suggestedmessages can be generated which describe the embedded application and/orthe embedded session, e.g., outside the context of a particular useraction or particular type of suggestion event. For example, suggestedmessages can include general comments about the embedded application,e.g., “This game is great!” or “Check this movie out!” etc. Such generalmessages can also be generated in response to other types of suggestionevents.

In some examples, suggested messages can indicate or describe userreactions to a suggestion event. In some implementations, such asuggested message, when selected by a user, can be displayed as a chatmessage in the chat conversation. Such suggested messages can be textmessages, for example. In some examples, suggested messages thatdescribe user reactions can be determined as stored predefined messagesthat are associated with particular topics, words, or phrases occurringas a basis of the suggestion event, or are associated with particularactions used to detect the suggestion event. In some implementations, amachine learning model can be used that is trained based on synthetic oractual training data, e.g., predetermined synthetic messages or previousactual messages provided by users in reaction to predetermined orprevious suggestion events that are the same as the detected suggestionevent (e.g., the same types of user actions, chat input, events, etc.that were detected as previous suggestion events).

In some example implementations in which the embedded application isplaying a media item, suggested messages can be determined based on thesuggestion event. For example, if the suggestion event is a chat usernamed User2 joining the embedded session to view the media item, then asuggested message can be “welcome User2!”. In another example, if thesuggestion event is a particular detected type of visual or audiofeature or type of scene or sequence (e.g., a detected action scene orsequence) that has been detected in the played media item, suggestedmessages can include exclamations or observations relevant to thedetected type of feature or scene, e.g., “Wow that was great!” or “Cutebaby.” For example, such message suggestions can be determined based onpredefined associations between messages and content features andscenes, and/or with a machine learning model that has been trained usingsynthetic or actual data including prior content features and prior usercomments or responses in reaction to those features. In another example,if the suggestion event is a change in the playback position or outputcharacteristics (e.g., audio volume or visual brightness or contrast) ofthe media item caused by another member user, a suggested message can bea reaction to the change, such as “good, I was tired of that” or “wait,I wanted to watch that!” In another example, a server event may havebeen received by the messaging application from a server as describedabove. In one example, the played media item in the embedded session isa video created by a first member user, User1, the media item has beenavailable for viewing by users from the server, and the server eventindicates that a threshold number of approvals by users have beenreceived by the server for the media item. A suggested message for themember users other than the first member user can be “congratulations,User1” or similar praise for the first member user.

In some example implementations in which the embedded applicationprovides a game, the suggested messages can be determined based on thesuggestion event related to a game event. For example, if the suggestionevent is a game action by a different player of the game, a suggestedmessage can be one or more possible or predefined reaction messages tothe game action, e.g., “great move!” or “great answer!” (e.g., to aselection in a quiz game providing a choice of multiple answers). Inanother example, if the suggestion event is an invasion of a user's gameterritory by enemy game pieces, the suggested messages can includereactions such as “Hey, don't come after me” or “You'll regret thatmove!” In another example, if the suggestion event is the user's scorebecoming different from (e.g., trailing or leading) other players'scores or objectives by a threshold amount or more, suggested messagescan include boasts or laments by the player, e.g., “You guys will nevercatch me.” In another example, if the suggestion event is another playerjoining the game, suggested messages can include a message request tothe new player to join the user's team in the game, and/or sending amessage request to a different player to form a team against the newplayer. In another example, if the suggestion event is a member userexiting the game (or has changed from a player role to an observer rolein the game), a suggested message can be “Thanks for playing.” Suchsuggested messages can be determined similarly as described above.

In some example implementations in which the embedded application isproviding a shared content document (e.g., shared list) of items, thesuggested commands can be determined based on the suggestion eventrelated to the list or document. For example, if the suggestion event isthe addition of an item (e.g., “steak”) to a food list by a differentmember user, the suggested messages can include messages that inquireabout the item or request to remove the item from the list, e.g., “do weneed the steak?” or “I suggest removing the steak.” In someimplementations, the suggested message can be associated with ahighlighting command to highlight the item as described above. Inanother example, if the suggestion event is removal of an item, asuggested message can include outputting text in chat interface, e.g.,“why did you remove that item?” Such suggested messages can bedetermined similarly as described above.

In some example implementations in which the embedded applicationprovides travel itineraries, if the suggestion event is the output ofmultiple travel itineraries from which to select, suggested messages caninclude descriptions of the itineraries, requests to other chat usersfor comments or suggestions as to which itinerary to select, etc.

In another example that can be applied to many types of embeddedapplications, if the suggestion event is a member user joining theembedded session, a suggested message can be to ask the new member userwhether he or she wants control over functions of the embeddedapplication (if the first user has been assigned a user status or rolein the embedded application that allows such assigning of control). Insome implementations, a suggested message can be to ask a member user tostop using abusive or inappropriate language if the messagingapplication (or other program or device) has detected such language inmessages from the designated user in the chat conversation.

In additional examples, a suggestion event can be the user devicereceiving a phone call while the user is participating in the chatconversation, and a suggested message can be “Hang on, let me take thiscall from my boss” for display in the chat conversation. A suggestionevent can be the user device receiving a Short Message Service (SMS)message while the user is participating in the chat conversation, and asuggested message can include the content of the SMS message for displayin the chat conversation. A suggestion event can be the user devicegoing offline, and a suggested message can include “sorry guys, my phonelost connectivity for a minute.” A suggestion event can be the userdevice alternating between online/offline status, e.g., for a thresholdnumber of times within a threshold time period, during display of avideo in an embedded session, and a suggested message can include,“sorry guys my connection is very choppy, I'll watch that video later.”A suggestion event can be a chat user exiting a chat conversation (e.g.,detected as a server event), and this can trigger generation of asuggested messages to all the other (remaining) chat users, where thesuggested messages relate to that user quitting the chat conversation(e.g., “shall we stop the movie?”, etc.).

Suggested messages can, if user consent has been obtained, also oralternatively be based on a history of prior messages and/or actionsperformed by the user in embedded sessions involving that same orsimilar types of embedded applications and/or for same or similar typesof content items (e.g., media items, games, etc.). For example, if theuser has previously reacted to a change in playback position of aparticular scene or type of scene in a video by sending a message of“Please change it back,” then a similar suggested message can begenerated in response to the occurrence of a similar suggestion event,where the suggested message provides a similar reaction.

Suggested messages can also or alternatively be based on member userinput in the chat conversation, as displayed in the chat interface ofthe messaging application. For example, if during a game, a member userinputs a message in the chat conversation that says, “help me get thisobjective,” suggested messages can be generated that are “sure, will do”or “I can't help you right now.” In another example, if during playbackof a media item in the embedded interface, member user inputs, “whattime should I start at?” then suggested messages can be generated thatindicate various times, such as different chapter headings (e.g., “go to28:30—The Visit.”) or a suggested message can indicate the time orposition of a known favorite scene of the user, if user priority historycan be accessed with user consent.

Some suggested messages can be associated with one or more suggestedcommands that have been determined in block 714. If a suggested commandis selected by the user, a suggested message associated with thatcommand can be output in the chat interface while the command isprovided to the embedded application. In some implementations, such asuggested message can relate to the associated suggested command, e.g.,emphasize or explain the command provided. For example, if a suggestedcommand is selected to take an action responding to a different player'sprevious action in a game, then one or more associated suggestedmessages can be determined that can accompany that suggested command toemphasize it, such as “Take that!” and “I'm not defeated yet.” Inanother example, if a suggested command is selected to change a playbackposition for a media item to a new scene, an associated suggestedmessage can explain that change in playback (e.g., “I'm skipping pastthat scene” or “I got bored with that scene”). Some implementations cansimilarly display one or more suggested commands in response to aselection of a suggested message. In another example, if there is adiscussion or argument between chat users in the chat conversation, oneor more of the chat users can be presented with a suggested command toan embedded application to generate a visualization of the discussion,e.g., using other types of content data. For example, the embeddedapplication can generate a cinemagraph or other animated data with avisual representation of the discussion using user profile pictures.Editing options can be presented (e.g., to the user that selected thesuggested command) that allow a user to edit the animated data. Theembedded application can generate a suggested message that, if selectedby the user, causes the animated data to be displayed in the chatconversation as a chat message.

Some suggestion event types can cause generation of both suggestedcommands from blocks 714-718 and suggested messages from blocks 722-724.In some implementations, suggested commands for the embedded applicationcan be visually distinguished from suggested messages when displayed inthe chat interface. In some examples, suggested commands can bedisplayed with a common first visual feature, and suggested messages canbe displayed with a common second visual feature that is different thanthe first visual feature. For example, a particular color, typeface,highlighting (e.g., boldface text) or other visual feature can beapplied to suggested commands, and a different color, typeface,highlighting, or other visual feature can be applied to suggestedmessages.

In some implementations, a plurality of suggested messages can begenerated and can be ranked based on one or more predetermined criteria,similarly to suggested commands as described above. A particular numberof top-ranked suggested messages can be selected for output on a userdevice. The method continues to block 724.

In block 724, the one or more suggested messages obtained in block 722are output by the messaging application in the chat interface and/orembedded interface. For example, the suggested messages can be displayedin a list in the chat interface and can be selectable by the user,similarly as described above for suggested commands. Someimplementations can display the suggested messages in a persistent areaof the chat interface so that the suggested messages do not scroll offthe display when additional chat messages are displayed in the chatinterface.

In some implementations, the suggested messages can have a limiteddisplay time before automatically being removed from the chat interfaceby the messaging application, similarly as described above for thesuggested commands. For example, the suggested messages can be removedafter a time limit expires and/or based on one or more conditions beingmet. For example, if a suggestion event or application state causedparticular suggested messages(s) to be determined and displayed, andthat suggestion event or application state is no longer relevant,pending, or valid, then those particular suggested messages(s) can beremoved from the chat interface. In some examples, if suggested messagesare in response to a particular action performed by a different user inthe embedded application, and that different user performs a differentaction, then those suggested messages may no longer be relevant and canbe removed. In some examples, the embedded application can inform themessaging application of new events and states and/or when suggestionevents are no longer valid or pending, such that the messagingapplication can determine when to remove suggested messages fromdisplay. The method continues to block 726, described below.

If the suggestion event type does not provide suggested messages asdetermined in block 720, or after block 724, the method continues toblock 726, where it is determined whether a selection of one or moresuggested command items is received in the chat interface. For example,the selection can be received based on user input provided by the userin the chat interface to select displayed suggested command item(s). Insome implementations, the embedded interface can display suggested itemsin the embedded interface where they are responsive to user input forselection, as described above for block 718.

In some implementations, multiple suggested command items can beselected by user input. In some examples, as described above, aselection can be received for a suggested command item, which causes alist of suggested message items to be displayed that are associated withthe suggested command item. The user can then select one (or more) ofthe associated suggested message items. In some implementations, aselection can be received for a suggested message item, which causes alist of suggested command items to be displayed that are associated withthe suggested message item. The user can then select one (or more) ofthe associated suggested command items.

If a selection of one or more suggested command items is received asdetermined in block 726, then the method continues to block 728, wherethe messaging application provides one or more selected command(s) tothe embedded application which are associated with the selected commanditem(s). In some cases, one or more selected commands associated withthe selected command item are provided to the messaging applicationand/or the first user device as described above, instead of or inaddition to commands provided to the embedded application. In someimplementations, multiple commands are associated with a single selectedsuggested command item. The embedded application, message application,and/or first user device implements the provided command(s). Forexample, the command may cause a change in state of the embeddedapplication (e.g., change in playback position of a media item, changein position or status of a user-controlled game piece, change in ashared document, etc.). In some implementations, as described herein,the change in state is sent or indicated to one or more servers and/orto the other member devices over the network to allow synchronization ofembedded application states in the embedded session. The methodcontinues to block 730.

If a selection of one or more suggested command items is not received asdetermined in block 726, or after block 728, the method continues toblock 730, where it is determined whether a selection of one or moresuggested message items is received in the chat interface. For example,the selection can be received based on user input provided by the userin the chat interface to select a displayed suggested message item. Insome implementations, multiple suggested message items can be selectedby user input. Some implementations can select one or more suggestedmessage items in association with one or more suggested command items asdescribed above.

If a selection of one or more suggested message items is received asdetermined in block 730, then the method continues to block 732, wherethe messaging application outputs selected message(s) corresponding tothe selected message item to the chat conversation in the chatinterface. In some implementations, multiple messages can correspond toa single message item. In some examples, the selected message(s) can bedisplayed in the chat interface of the (first) device receiving the userselection of the message item, and the selected message(s) can betransmitted over the network to the chat devices participating in thechat conversation and displayed in the chat interfaces of those devices.In some implementations, the selected message(s) can be transmitted to aparticular subset of the chat devices for display in their associatedchat interfaces, e.g., to member devices in the same embedded session asthe first device, to devices of particular chat users based on userselection or preferences, to devices of particular user statuses orroles in the embedded session, to devices on the same team or opposingteam in a game of an embedded session, etc.

In some implementations, the number of suggested messages output in thechat conversation can be limited, e.g., so as to reduce the effect ofmany chat messages crowding the chat interface. For example, themessaging application can impose a maximum number of selected suggestedmessages that can be output to the chat conversation within a particularperiod of time, or can impose a minimum amount of time between theoutput of successive selected suggested messages from a particularmember user or from all chat users. Thus, if the selected suggestedmessage does not qualify for output, then the message is not output tothe chat conversation in block 732.

If a selection of one or more suggested message items is not received asdetermined in block 730, or after block 732, the method can continue toblock 708 to continue execution of the embedded application.

In some implementations, a particular embedded application can be opened(e.g., minimized in a corner) to continually parse and/or otherwiseprocess chat messages in the chat conversation and provide suggestedcommands and/or messages based on the chat messages. For example, theembedded application can present suggested messages that are topics,videos, images, cinemagraphs, audio data segments, etc., based on thecontent of the chat conversation. This can assist a user to post contentrelevant to the chat conversation. In some of these implementations,suggestion events can be continually being detected based on currentchat messages being input by chat users in the chat conversation, andnew suggested commands and/or messages can be continually being providedfor user selection in the chat interface and/or embedded interface.

In some implementations, suggested responses can be determined andpresented to multiple member users (and/or chat users) based on thesuggestion event, e.g., displayed on each member device or chat device(or selected member devices or chat devices). In some examples, thesuggested responses can be the same suggested commands and/or suggestedmessages provided on each of the multiple member devices, or differentsuggested responses can be provided to each of two or more of the memberdevices. In some examples, member devices of Users 1, 2 and 3 receive achat message from User 4 of the chat conversation, and each memberdevice (or multiple member devices) of Users 1, 2, and 3 may present adifferent set of suggested responses (e.g., each set having at least oneresponse different from one or more of the other sets). Each set ofsuggested responses can be based on the context of the member devicepresenting the set, e.g., based on the associated chat messages input bythe associated user in the chat conversation, a history of chat messagesof the associated user (if user consent has been obtained), and/or otherfactors as described herein. In some examples, the set of suggestedresponses can be based on one or more particular embedded applicationsthe associated user has been using. For example, if User 4 inputs a chatmessage, “We need to buy drinks for the party tonight,” and if User 2 isa frequent user of a shared list embedded application, the user deviceof User 2 can provide a suggested command that (when selected) adds anitem ‘Buy Drinks’ to a shopping list in that application. Selecting thatsuggested command can cause the shared list embedded application to openand can cause the item “Buy Drinks” to be automatically to the sharedlist of the shared list embedded application. User 3, however, is not afrequent user of the shared list embedded application (e.g., has notused the application more than a threshold number of times within aparticular amount of time), and the user device of User 3 does notdisplay that suggested command in this example. The user device (e.g.,messaging application) of User 3 may display a different suggestedcommand for a different embedded application that is frequently used byUser 3, e.g., a map application that displays a geographical location ofbusinesses at which to purchase drinks. In another example, User 3'sdevice can provide a suggested message that is the same as a previousmessage previously input or selected by User 3 in response to a similarchat message displayed in the chat conversation (or, alternatively, inany chat conversation) on a previous occasion (e.g., the previous chatmessage having one or more of the same words, the same semantic meaning,etc.).

In some implementations, relevant suggested responses can be determinedthat are related to one or more particular content items provided in theembedded interface. For example, if member users are using (or havepreviously used) a shared list embedded application to generate a firstlist for travel preparation and a second list for party organizing,suggested responses can refer to one of these lists and not the otherlist, e.g., based on content of chat messages and/or one or more othersuggestion events. In some examples, in response to a chat message suchas “don't forget to buy drinks for tonight,” a machine learning modeland/or knowledge graph can determine that “tonight” and “buy drinks”refers to a “party” that the chat members are organizing, and provide asuggested response that (when selected) adds an item “buy drinks” to thecorresponding second list for party organizing. In response to a chatmessage such as “have you booked the plane tickets for our trip,” themachine learning and knowledge graph can determine that “plane tickets”and “trips” refer to travel, and provide a suggested response that (whenselected) adds an item “book plane tickets” to the corresponding firstlist for travel preparation.

In some implementations, a suggested response, when selected, cantrigger a display of identifications of multiple associated embeddedapplications, e.g., to allow a user to select a desired embeddedapplication to be executed or to receive data based on the suggestedresponse, thus reducing ambiguity. In some implementations, a suggestedresponse, when selected by a user, can cause display of a request as towhich embedded application should be triggered by the selection of thesuggested response. In some cases, multiple possible embeddedapplications that are suitable for a selected suggested response can bedisplayed, and user input can indicate the embedded application toexecute. For example, if a selected suggested response adds an item to ashared list, and two different available embedded applications providesuch lists, identifications of these two embedded applications can bedisplayed and the user can select one of the embedded applications touse.

In some implementations, suggested responses can be displayed within theembedded interface and receive selection from user input while displayedin the embedded interface (e.g., via touch input on a touchscreen, orvia a user-controlled cursor positioned in the embedded interface). Forexample, suggested responses can be displayed in response to occurrenceof suggestion events in the embedded application. In some examples, asuggestion event in a game can be a user player causing an opponentplayer's avatar or game piece to be defeated or removed, and a first setof suggested messages can be displayed on the winning player's memberdevice (e.g., messages bragging about the move), and a second set ofsuggested messages can be displayed on the losing player's member device(e.g., messages whining about the loss). When selected by user input,such suggested messages cause chat messages indicating the desiredcontent to be provided in the chat conversation. In another example, thesuggestion event is a notification in the embedded application andembedded interface of a first user's device that a second user hasjoined the game, and a suggested response, when selected, causes a tauntor challenge to be output to the second player's user device (“Let's go,User 2,” “I'm gonna beat you at this game”, etc.) and/or to all memberdevices (or alternatively, to all chat devices).

In some implementations, embedded applications (e.g., scripts) can beattached to (associated with) a suggested response by, e.g., beingencoded directly in the data of a suggested response or in auser-selectable ink (or other displayed selectable control) included ina suggested response. For example, small embedded applications of fewhundred kilobytes can be so attached. When the suggested response isselected by the user, the attached embedded application is triggered toopen (after decoding), e.g., instead of downloading the embeddedapplication from a source (e.g., embedded application server 150) overthe network. In some cases, this feature can eliminate or reduceadditional download time of embedded application data, and can providean immediate execution and display of an embedded interface. In someimplementations, the attached embedded application can be a lightweightversion and is executed in addition to triggering downloading a morefull version of the embedded application in the background of the devicethat can replace the lightweight version on the device after thedownloading has occurred.

In some implementations, an attached embedded application can execute inthe background of an operating system (or other software environment) ofthe device (e.g., in a “headless mode”), which does not cause anembedded interface or other output to be displayed by the embeddedapplication. For example, the attached embedded application can generatesuggested responses displayed in the chat interface. Attached embeddedapplications can provide instant extensions and capabilities to themessaging application that can be created on-the-fly during a chatconversation, e.g., based on messages of a chat conversation and/orassociated suggested responses selected by a user. The messagingapplication can use APIs and capabilities of attached embeddedapplications without needing to download and execute a correspondingversion of the embedded application that, e.g., displays its ownassociated embedded interface.

In some implementations, an attached embedded application can beassociated with or attached to a chat conversation for which it isexecuted, e.g., in an ongoing association with the chat conversation.For example, the attached embedded application can act as an extensionto the chat conversation, e.g., where the embedded application executesin the background while the chat conversation is open and/or displayedon the device. Such an attached embedded application can process chatmessages that are input to the chat conversation and perform actions inresponse to chat messages, e.g., provide auto-replies to certain typesof chat messages, auto-translate chat messages into a differentlanguage, provide always-on location sharing (indicating a currentgeographic location of the user device) while the messaging applicationis open (with user consent), add displayed graphical interface elementsto the chat interface, etc. In some examples, the chat messages of thechat conversation can be auto-translated into and displayed as messagesin a different language, e.g., by having an attached embeddedtranslation application as an extension of the messaging application.Extension embedded applications can augment a camera application orimage picker application, e.g., to modify media items such as imagesbefore such media items are shared with other devices in a chatconversation or via a different embedded application. In furtherexamples, an extension embedded application can anonymize a chatconversation or particular users in the chat conversation (e.g., changethe displayed user identifiers of the chat users), reorder the displayof chat messages in the conversation (e.g., group the messages by theme,by threads including successive replies to an original chat message,etc.), enable functions in the chat interface accessible to user input(e.g., displayed controls to pin chat messages or media items posted inthe chat conversation to be persistently displayed in a display area ofthe chat interface, or controls to attach comments to media messagesthat are stored, e.g., in a shared database).

In some implementations, an attached embedded application provides aone-time execution for the chat conversation, e.g., to modify andre-share an image input to the chat conversation, or a one-timetranslation of a chat message. In some implementations, such embeddedapplication extensions and/or one-time scripts can be downloaded from aserver, or can be directly attached to user-selectable chat messages orsuggested responses (links) (e.g., as encoded scripts provided as aparameter of a web address (e.g., Uniform Resource Locator (URL)).

In a similar manner, attached embedded applications (e.g., small-sizedapplications that use a few hundred KB of memory) can be encoded in thedata of a selectable link in a chat message or in the data for aninteractive card that is displayed in the chat interface or chatconversation, and can be executed upon selection of that chat messagelink or control in the interactive card.

In some implementations, suggested responses can be generated based onsuggestion events occurring at external devices or programs outside themessaging application and the chat conversation, e.g., as describedabove, and the suggested responses can provide commands and/or messagesoutput to the external devices or programs. For example, an embeddedapplication can communicate with an online game (e.g., a game executingon a server), and commands input to the embedded application can affectthe state of the game, e.g., be conveyed to the game server. If an eventoccurs in the game which can be responded to by the first user providinginput to the embedded application, a suggested response can include anaction providing input to the embedded application that will cause aresponsive user action in the online game.

In some implementations, suggested responses can be generated based onsuggestion events and/or particular events that occurred in the past, ifconsent of the applicable users has been obtained to do so. The previousevents can be indicated or described in stored historical data, forexample. In some examples, a log of previous chat messages input in aprevious chat conversation between two users can be used to determinemessages to be included as newly-generated suggested responses for acurrent chat conversation that includes the same two users. A suggestedresponse can be based on a prior history describing a particular user'sperformance in an embedded game application, such as previous objectivesor scores attained by the user in the game. For example, a suggestedmessage of “You're doing better than before!” can be displayed for User1 based on User 2's current score in the game being higher as comparedto User 2's previous score in a previous game in that embedded gameapplication. Recorded previous interactions between users in embeddedapplications can also be used to generate suggested responses, if userconsent has been obtained. For example, previous user interactions in agame application can be used to generate a new suggested game actionthat was successful in a previous game, and/or generate a suggestedmessage (e.g., “I'm doing better than you this time”), or previous usercontributions to a shared document application can be used to generate asuggested command to add the same contributions to a new shareddocument, etc. In another example, if it is determined that an additionof a list item was previously made by a user to a first shared list inan embedded list application, as described in stored historical data, asuggested command can be generated for that user with respect to anewly-created, second shared list that, e.g., has the same or similarlabel or title as the first list. For example, the suggested command,when selected, adds the same list item to the second list, where thesecond list has been determined to have the same label (e.g., “ShoppingList”) as the first list.

In some implementations, the number of displayed suggested responses canbe limited, e.g., by consolidating multiple suggested responses into asingle suggested response that is displayed. For example, a singlesuggested response can, when selected, cause multiple actions or inputsto one or more applications (embedded applications, messagingapplication, server, etc.). In some examples, a suggestion event is theinput of a chat message “Don't forget Timmy's birthday on Friday” by adifferent chat user in the chat conversation. Determined suggestedresponses to this chat message can include a suggested message “don'tworry” (chat message), a suggested command to add ‘Timmy's Birthday’ tothe first user's calendar, a suggested command to set an alarm orreminder on the first device to activate on Timmy's birthday, and asuggested command to add an item ‘Buy a present for Timmy's birthday’ toa shopping list in a list embedded application. These three suggestedcommands trigger actions in embedded applications and/or bots. However,the three suggested commands may occupy a large amount of screen realestate and so can be combined into a displayed consolidated suggestedcommand, e.g., “Set reminders for Timmy's birthday.” When selected byuser input, this consolidated suggested command causes a selection menuto be displayed that includes the three individual suggested commands.Any or all of these individual suggested commands can be selected byuser input.

In some implementations, suggested response items determined for a firstchat conversation can, when selected by user input, provide commands ormessages to a different, second chat conversation, e.g., implemented bythe messaging application (or a different application). Users may beparticipating in multiple chat conversations in parallel, and selectedsuggested responses in one chat conversation can trigger actions in adifferent chat conversation. For example, in a first chat conversationbetween User 1 and User 2, User 1 inputs the chat message, “User 2,don't forget Timmy's present for his birthday.” This message may be asuggestion event that causes a suggested response (command) to begenerated on the device of User 2. When this suggested response isselected by user input, an item “Buy present for Timmy” is added to abirthday list that has been created in an embedded application in asecond chat conversation in which User 2 is participating. In anotherexample, User 1 and User 2 are inputting chat messages in a first chatconversation about a game that User 1 is playing in a second groupconversation, and a suggested response is generated that, when selectedby User 1, causes a particular chat message (or other displayed prompt)to be output in the first chat conversation. For example, the particularchat message can invite User 2 to join the game in the first chatconversation, or cause display of an interactive card on User 2's devicethat includes a displayed join control.

In some implementations, suggested responses may be customized based onembedded applications that have been executed at least once by the firstdevice. In some implementations, suggested responses may be customizedfor a chat conversation based on embedded applications that have beenexecuted at least once by the first device in that same chatconversation. In some implementations, suggested responses may becustomized based on embedded applications that have been executed atleast once by a device of one or more member users, or in someimplementations by the device of one or more chat users. For example, acommand or message to an embedded application can be provided as asuggested response on a device (in response to a suggestion event) ifthat embedded application has been executed previously by that device.In some examples, if the first device has previously executed a sharedlist embedded application, then when a chat user inputs chat messages inthe chat conversation that include particular items (e.g., words,images, or other content data) related to event organizing orrecommendations, a suggested response can be generated on the firstdevice that is a command to add those particular items to an existing ornew list in the shared list embedded application. In some examples,member devices that did not previously execute the shared list embeddedapplication would not display the suggested response related to theshared list embedded application. In some implementations, if any memberdevice (or chat device) has previously executed the embeddedapplication, the suggested command or message can be provided on one,some, or all member devices (or chat devices).

In some implementations, one or more suggested response items can begenerated based on invoking or requesting information from one or morebots accessible to the device providing the suggested response items.For example, if the suggested item generation component (e.g.,suggestion server or other component of the system) determines that anappropriate suggested item would be particular information relevant tothe content of a played media item, a bot that can obtain thatinformation can be determined and a command and/or request to the botcan be generated as a suggested item.

In some implementations, if a selected suggested response item is acommand or request to a bot, the bot can be added to the chatconversation and obtains and displays requested information in the chatinterface, and the users can send further messages to the bot.

In various example implementations that use features described above, achat interface can be displayed by a first user device as generated by amessaging application as described above. The chat interface isconfigured to display one or more messages provided in a chatconversation configured to display messages provided by user devicesparticipating in the chat conversation over a network. An embeddedinterface is provided by a first embedded application and displayed inthe chat interface. A suggestion event is determined to have occurred inassociation with the first embedded application (or the messagingapplication), e.g., based on received data that indicates that aparticular event has occurred at one or more of the plurality of userdevices that are participating in the chat conversation, wherein the oneor more of the plurality of user devices are different than the firstuser device. The first user device (e.g., the messaging application)obtains one or more suggested response items based on the suggestionevent, and the suggested response items are displayed by the first userdevice.

For example, the particular event can include user input received by anassociated chat interface of the one or more of the plurality of userdevices, user input received by an associated embedded interface of theone or more of the plurality of user devices, an embedded applicationevent occurring in an associated embedded application executing on theone or more of the plurality of user devices, etc. The received data canindicate a type of content feature displayed in a media item beingplayed by the first embedded application, achievement of a predefinedobjective in a game of the first embedded application, user inputreceived by a receiving user device participating in the chatconversation, initiation of the embedded application from a particularuser device of the plurality of user devices, etc. The received data caninclude chat messages. The suggestion event can be based on, e.g., userinput received in the chat interface and/or in the embedded interface,and/or based on event information from the first embedded applicationindicating that a particular event has occurred in the first embeddedapplication (and/or occurred in a corresponding embedded applicationexecuting on a different chat device). The one or more suggestedresponse items can be determined by the embedded application, themessaging application, and/or a remote server in communication with themessaging application over the network. In some examples, the embeddedinterface can be output on a subset of the user devices participating inthe chat conversation, where the user devices received a user selectionto join an embedded session involving the first embedded application.The first embedded application can display embedded output data that isgenerated by the first embedded application and/or received from aserver over the network.

Features for such implementations can include receiving user inputselecting a selected suggested response item from the suggested responseitems, outputting a chat message associated with the selected suggestedresponse item in the chat conversation of the chat interface of thefirst user device, e.g., such that the chat message is displayed by oneor more other user devices of the user devices participating in the chatconversation. For example, the suggested response items can include oneor more chat messages that indicate user reactions to the suggestionevent, and/or can include one or more commands provided to the embeddedapplication and/or to the messaging application. In some examples, acommand to the embedded application can include a command to perform anaction in a game implemented by the embedded application, a command tochange a playback position in a playing of media data by the embeddedapplication, and/or a command to change a shared object provided by theembedded application. In some examples, the suggested response itemsproviding suggested commands are visually distinguished from thesuggested response items providing suggested messages when displayed inthe chat interface.

In further examples, the first embedded application can be a mediaplayer application causing display of video data (or other content data)in the embedded interface that is displayed by a subset of the userdevices participating in the chat conversation, where the embeddedinterface is configured to receive user input controlling the playbackof the video data, and the suggested response items can include one ormore suggested playback commands operative to adjust the playback of thevideo data. In another example, the first embedded application can be agame application causing display of game data in the embedded interfacethat is displayed by a subset of the user devices participating in thechat conversation, where the embedded interface is configured to receiveuser input that changes one or more states of the game application, andthe suggested response items can include one or more suggested commandsoperative to modify at least one state of the game application. Inanother example, the first embedded application can be a shared documentapplication causing display of a shared content document (e.g., list ofitems) in the embedded interface that is displayed by a subset of theuser devices participating in the chat conversation, where the embeddedinterface is configured to receive user input that changes one or moreitems in the shared document, and the suggested response items includeone or more suggested commands operative to modify the shared document.

In additional examples, a server device can receive join indications (orrequests) over the network from chat devices that have initiated anembedded application associated with an existing embedded session. Thejoin indications are sent by the server device to other chat devices(member devices) over the network that are in the embedded session tosynchronize the joining devices with the member devices of the embeddedsession.

The methods, blocks, and operations described herein can be performed ina different order than shown or described, and/or performedsimultaneously (partially or completely) with other blocks oroperations, where appropriate. Some blocks or operations can beperformed for one portion of data and later performed again, e.g., foranother portion of data. Not all of the described blocks and operationsneed be performed in various implementations. In some implementations,blocks and operations can be performed multiple times, in a differentorder, and/or at different times in the methods.

In some implementations, some or all of the methods can be implementedon a system such as one or more client devices. In some implementations,one or more methods described herein can be implemented, for example, ona server system, and/or on both a server system and a client system. Insome implementations, different components of one or more servers and/orclients can perform different blocks, operations, or other parts of themethods.

In various implementations, a messaging application, an embeddedapplication running in association with a messaging application, and/ora server in communication with the messaging application may perform oneor more blocks of the described methods.

FIGS. 8A-8E are graphic representations of example user interfacesdisplayed by user devices, e.g., client devices. In these examples, amessaging application is used for a chat conversation between users andan embedded media player application is used in association with themessaging application.

In FIG. 8A, an example of a first chat interface 800 of a firstmessaging application is displayed on a first user device operated by afirst user (e.g., “Sarah C.”). In this example, a chat conversation“HanginOut” has been initiated that includes participation of the firstuser and first device, as well as participation of one or more otherusers and user devices. Chat messages from the chat users to the chatconversation can be input at respective user devices, sent to the firstuser device if applicable, and displayed in the chat interface by themessaging application. For example, chat messages from the first usercan be input in an input field 802 of the chat interface 800 (e.g., viainput devices such as a physical keyboard, displayed touchscreenkeyboard, voice input, etc.). The chat messages can be displayed in amessage display area 804 the chat interface 800.

In this example, the first user has input a command in the input field802, where the received command is displayed as message 806 in the chatinterface after being input. This command specifies an embeddedinterface to be displayed in association with the chat conversation. Inthis example, the embedded interface is provided by an embeddedapplication that is a video player “vidplay” executing on the firstdevice. The command also specifies a media item to play with the videoplayer application, a video segment “MusicVidA.” The command also has a“share” parameter to cause the playing of the video to be shared in thechat conversation as an embedded session. In some implementations, themedia player application can be selected to display the embeddedinterface without sharing its output in an embedded session associatedwith the chat conversation. In some implementations, instead ofinputting the command shown, the first user can select to play the mediaitem by browsing a menu that displays media items and selecting thedesired media item, or selecting the media item in a different way. Insome implementations, the first user can execute the embeddedapplication without selection of a media item, and then select a mediaitem using a menu of the embedded application, e.g., in the embeddedinterface.

In response to the command 806, a response message 808 can be displayedin the chat interface by a bot or the messaging application, e.g., as ifthe bot or messaging application were a chat user. Response message 808indicates that the selected embedded video player application is beingexecuted. In some cases or implementations, the selection of theembedded application (and/or media item) causes the embedded applicationto be downloaded to the first device in the background, e.g., from anembedded application server over the network connected to the firstdevice.

The embedded application executes on the first device and displays anembedded interface 810. In this example, embedded interface 810 isdisplayed within chat interface 800, e.g., within message display area804 of the chat interface. In some implementations, the embeddedinterface 810 is displayed based on data received by the first deviceover the network, e.g., from an embedded application at least partiallyexecuting on a remote session server or other device connected over thenetwork. In this example, the embedded interface 810 is displayed suchthat message display area 804 is at least partially displayed, e.g.,allowing one or more chat messages in the message display area 804 to besimultaneously displayed with the embedded interface 810.

Embedded interface 810 includes a display area 812 for displayingcontent data of a media item (e.g., video data, image data, etc.), aseek control 814 allowing the first user to provide user input to changethe playback position of the media item along a timeline (e.g., movingthe control left or right), and a full screen control 816 allowing userinput to enlarge the embedded interface 810 to the entire screen (orother display area) of the first device. A user identifier 818 can bedisplayed to indicate which user of the chat initiated the embeddedsession associated with the interface 810. The user identifier 818 isshown as an identifying image, but can also or alternatively be text(e.g., name), etc. A list 820 can show the media item that is currentplaying in the display area 812 and other media items that are queued toplay after the media item is completed. A close control 822 allows userinput to close the embedded interface 810 and close the embeddedapplication, e.g., so that it is no longer executing on the firstdevice.

In some implementations, one or more embedded application indicators 824can be displayed in the chat interface to indicate which embeddedsessions are current active. Some implementations can also display anindicator in the chat interface to indicate updates to the embeddedsession (e.g., user input to a corresponding embedded interface) sincethe last time that the first user was a member user of that embeddedsession. For example, such an indicator can be an indicator 826displayed in association with (e.g., adjacent to or overlapping) theembedded application indicator 824.

In FIG. 8B, an example of a second chat interface 840 of a secondmessaging application is displayed on a second user device operated by asecond user (e.g., “Emily D.”). In this example, the second user is aparticipant in the chat conversation “HanginOut” that includes the firstuser and first device as described for FIG. 8A. Chat messages can beinput by the second user in the chat interface 840, e.g., via the inputfield 842 and an input device (e.g., on-screen keyboard, etc.). In thisexample, the second user has input a message 844 to the chatconversation, which is displayed in a display area 848 of chat interface840. In response to message 844, the first user has input a message 846to the chat conversation, as displayed in display area 848 of chatinterface 840.

In addition, an embedded session notification 850 is displayed in chatinterface 840. Notification 850 indicates that an embedded session isactive, which in this example utilizes the embedded video playerapplication that was executed by the first user in FIG. 8A. Notification850 can be displayed in chat interface 840 after the second devicereceives information from a session server or a chat device that theembedded session has been initiated and is active. Notification 850 isdisplayed in this example below the display area 848 in the chatinterface 840, or can be displayed in other areas of the chat interface840 (or outside the chat interface 840) in other implementations.

In this example, notification 850 includes a designation 852 (e.g., iconor symbol) of the embedded video player application that was executed bythe first user in FIG. 8A to initiate the associated shared embeddedsession. Notification 850 also includes the name 854 of the media itemthat is being played in the embedded session. Notification 850 alsoincludes a list 856 of the chat users who have joined the embeddedsession, e.g., are currently member users of the embedded session.Notification 850 also includes a join control 858 which is receptive touser input to cause the second user and second device to join theembedded session if selected. Notification 850 also includes a closecontrol 860 which is receptive to user input to cause the notification850 to be removed from the chat interface 840.

In FIG. 8C, the chat interface 840 of FIG. 8B is shown with an exampleupdate after the second user has selected to join the embedded sessionindicated in the notification 850 of FIG. 8B. For example, the seconduser may have selected the join control 858 of FIG. 8B. In FIG. 8C, anembedded interface 870 has been displayed in the chat interface 840. Forexample, embedded interface 870 can be provided by a second embeddedapplication that has been downloaded (in some cases) and executed by thesecond device in response to the second user joining the embeddedsession. In other implementations, the embedded interface 870 isdisplayed based on data received over the network, e.g., from anembedded application at least partially executing on a session server orother device. The second embedded application corresponds to the videoplayer application that provides the embedded interface 870 on the firstdevice of FIG. 8A. In this example, the embedded interface 870 isdisplayed such that message display area 848 is at least partiallydisplayed, e.g., allowing one or more chat messages in the messagedisplay area 848 to be displayed during display of the embeddedinterface 870.

After the second user and second device have joined the embeddedsession, the playback position of the media item displayed in theembedded interface 870 is synchronized with the current playbackposition of the embedded session, e.g., as shown on the embeddedinterface 810 of the first device of FIG. 8A. Thus, the second userstarts viewing the playing media item at a playback position after thestart of the media item, and shares the viewing experience with theother member users of the embedded session. The embedded interface 870includes features similar to embedded interface 810, e.g., a displayarea 872, a seek control 874 allowing the second user to provide userinput to change the playback position of the media item along atimeline, a full screen control 876, a user identifier 878 thatindicates the user who initiated the embedded session associated withinterface 870, and a close control 882. A list 880 shows the media item884 that is current playing in the display area 872 as well as anidentifier of the user that instructed to play media item 884. In thisexample, list 880 also includes a second media item 886 that is queuedto play after the media item 884 completes playing, and includes anidentifier of the user that instructed to play media item 886.

In this example, the second user has been permitted control overplayback functions in the embedded session, and the second user canmanipulate the seek control 874 to change the current playback positionof the media item, e.g., to a position before or after the currentposition. Such a change is imposed on all the embedded interfacesdisplayed by the member devices of the embedded session, such that themedia item viewing is synchronized among member devices. In other casesor implementations, the second user may not have been providedpermission or privileges (e.g., from the first user that activated theembedded session) and would not be able to adjust the playback positionof the media item.

In FIG. 8D, the chat interface 840 of FIG. 8C is shown with an exampleupdate after the second user has selected to input a new message in thechat conversation of the chat interface. For example, the second usermay have selected input field 842 of chat interface 840 during playbackof the media item in embedded interface 870. In some implementations,this can cause a displayed keyboard 890 to be displayed in or adjacentto the chat interface 840 (e.g., such that at least a portion of themessage display area 848 is still displayed), which can be used to inputa new message such as text 892. Text 892 can be displayed as chatmessage 894 when the text 892 is entered (e.g., via a return control inkeyboard 890). Some implementations can provide message suggestions 896as responses to the last chat message 846, any of which can be selectedby user input to provide a chat message having the selected messagesuggestion 896 in message display area 848 and to the chat conversation.

In some implementations, the embedded interface 870 can be resized toallow display space for both the keyboard 890 and chat messages of thechat conversation. In this example, embedded interface 870 has beenreduced in size as shown. Chat message 846 and new chat message 894 canbe displayed alongside the embedded interface 870.

In FIG. 8E, chat interface 840 is shown similarly as in FIG. 8C, with anexample user comment displayed in the embedded interface 870 andassociated with the playing media item. At the current playback positionof the media item displayed in the embedded interface 870, a usercomment 897 is displayed. In various implementations, displayed usercomment 897 can include a comment as well as an identification of theuser that input the comment.

In some implementations or cases, the information of user comment 897 isinput by a member user who is currently viewing the media item in theembedded session. For example, the user comment 897 can be displayed ata location in the display area of the embedded interface that is pointedto by the user, for a predetermined amount of time and then removed fromthe display. In some cases, user comment 897 may have been previouslyinput by a chat user while the chat user was viewing the same media itemon a previous occasion while participating in the chat conversation(which, for example, can be an ongoing chat group). For example, themedia item may have been played in a previous embedded session in thechat conversation by a chat user, who input the user comment at aparticular playback position and location in the display area. The usercomment was stored in association with the chat conversation, mediaitem, and playback position. When the media item is displayed in thecurrent embedded session, the user comment 897 is displayed when theplayback position is at (or near, e.g., within a threshold time of) thesame position where the user comment was previously input.

In some implementations, one or more suggested response items 898 can bedisplayed in chat interface 840 and/or in embedded interface 870. Inthis example, suggested response items 898 are displayed in response toa detected suggestion event which is the display of the user comment 897in the embedded interface. In this example, a suggested command has beendetermined by the embedded application (e.g., as generated by amachine-learning model or other technique) and provided to the messagingapplication for display in chat interface 840. The suggested commandwould, if executed, cause the embedded application to skip the videoplayback of the media item to the next user comment stored for theplaying video. If the user selects the suggested command, the command issent to the embedded application and playback in embedded interface 870is changed to a playback position at the next user comment. A suggestedmessage has also been determined, in this example in reaction to usercomment 897 as determined by the system (e.g., machine learning modelbased on training data providing sample user messages to similarcomments). Other suggested messages can be determined in response to anymember user actions in the embedded session, one or more chat messagesin the chat interface, etc. If the user selects the suggested message,the message is displayed as a chat message in chat interface 840, e.g.,in message display area 848. In some implementations, a selectedsuggested message can be added to the media item as a user commentsimilar to user comment 897. For example, the selected message can bepositioned within the embedded interface 870 and/or display area 872adjacent to (e.g., below) existing user comment 897 as a defaultposition. In some implementations, suggested response items such assuggested commands and/or suggested messages can be displayed inassociation with a displayed keyboard or other input controls, e.g.,similarly to message suggestions 896 shown in FIG. 8D.

FIGS. 9A-9C are graphic representations of additional example userinterfaces displayed by user devices. In these examples, a messagingapplication is used for a conversation between users and an embeddedgame application is used in association with the messaging application.

In FIG. 9A, an example of a first chat interface 900 of a firstmessaging application is displayed on a first user device operated by afirst user (e.g., “Sarah C.”). In this example, a chat conversation“HanginOut” has been initiated that includes participation of the firstuser and first device similarly as described for FIG. 8A. Chat messagesfrom the first user can be input in an input field 902 of chat interface900 (e.g., using an input device or keyboard similar to keyboard 890above) and the chat messages can be displayed in a message display area904 of chat interface 900.

In this example, the first user previously input a command in inputfield 902, and the received command is displayed as message 906 in thechat interface after being input. This command specifies an embeddedinterface to be displayed in association with the chat conversation. Inthis example, the embedded interface is provided by an embeddedapplication that is a game “Toads” which can execute on the first devicein some implementations. The command also has a “share” parameter tocause the game to be shared in the chat conversation as an embeddedsession. In some implementations, the game application can be selectedto display the embedded interface without sharing its output in anembedded session associated with the chat conversation. In otherimplementations, the first user can select to initiate the embedded gameapplication by selecting the embedded game application from a menu,list, etc.

In response to command 906, a response message 908 can be displayed inthe chat interface by a bot or the messaging application, e.g., as ifthe bot or messaging application were a chat user. Response message 908indicates that the selected embedded game application is being executed.In some cases or implementations, the selection of the embedded gameapplication causes the embedded game application to be downloaded to thefirst device in the background, e.g., from an embedded applicationserver over the network connected to the first device.

After the embedded application (or a portion thereof) has been stored onthe first device, the embedded application executes and displays anembedded interface 910. In this example, embedded interface 910 isdisplayed within chat interface 900, e.g., within message display area904 of the chat interface such that a portion of the message displayarea 904 remains displayed. In some implementations, the embeddedinterface 910 is displayed based on data received by the first deviceover the network, e.g., from an embedded application executing on aremote session server or other device connected over the network.

Embedded interface 910 includes a display area 912 for displaying outputof the game. The display area 912 can be receptive to user input, e.g.,selections of locations within the display area as commands to oractions within the game, in this example. A full screen control 914allows user input to enlarge the embedded interface 910 to the entirescreen (or other display area) of the first device. A user identifier916 can be displayed to indicate the first user of the chat interface asa player of the game. In some implementations, a game score 918 can bedisplayed next to (or otherwise associated with) the user identifier 916to indicate the current score of the identified user. A close control920 allows user input to close the embedded interface 910 and close theembedded game application, e.g., so that it is no longer executing onthe first device.

In some implementations, one or more embedded application indicators 924can be displayed in the chat interface to indicate which embeddedsessions are current active, similarly as described above.

In FIG. 9B, an example of a second chat interface 940 of a secondmessaging application is displayed on a second user device operated by asecond user (e.g., “Emily D.”). In this example, the second user is aparticipant in the chat conversation “HanginOut” that includes the firstuser and first device as described for FIG. 9A. Chat messages can beinput by the second user in the chat interface 940, e.g., via the inputfield 942. In this example, the second user has input a message 944 tothe chat conversation, which is displayed in a message display area 948of chat interface 940. In response, the first user has input a message946 to the chat conversation, as displayed in display area 948 of chatinterface 940.

An embedded session notification 950 is displayed in chat interface 940.Notification 950 indicates that an embedded session has been initiatedand/or is active, which in this example utilizes the embedded gameapplication that was executed by the first user in FIG. 9A. Notification950 can be displayed in chat interface 940 after the second devicereceives information from a session server or a chat device that theembedded session has been initiated and is active. Notification 950 canbe displayed in display area 948 or other areas of chat interface 940,or outside the chat interface 940 in various implementations.

In this example, notification 950 includes a designation 952 (e.g., iconor symbol) of the embedded game application that was executed by thefirst user in FIG. 9A to initiate the associated shared embeddedsession. Notification 950 also includes a list 956 of the chat users whohave joined (e.g., are currently member users of) the embedded session.Notification 950 also includes a join control 958 which is receptive touser input to cause the second user and second device to join theembedded session, if selected. Notification 950 also includes a closecontrol 960 which is receptive to user input to cause notification 950to be removed from the chat interface 940.

In FIG. 9C, chat interface 940 of FIG. 9B is shown with an exampleupdate after the second user has selected to join the embedded sessionindicated in the notification 950 of FIG. 9B, e.g., by selecting joincontrol 958 of FIG. 9B. In FIG. 9C, an embedded interface 970 isdisplayed in chat interface 940 such that a portion of the messagedisplay area 948 (and one or more chat messages) remain displayed. Forexample, embedded interface 970 can be provided by an embedded gameapplication that has been downloaded (in some cases) and executed by thesecond device in response to the second user joining the embeddedsession. In other implementations, embedded interface 970 is displayedbased on data received over the network, e.g., from an embeddedapplication executing on a session server or other device. The embeddedgame application corresponds to the embedded game application thatprovides embedded interface 910 on the first device of FIG. 9A.

After the second user and second device have joined the embeddedsession, the game states of the embedded interface 970 are synchronizedwith the current game states of the embedded session as implemented onthe corresponding embedded game applications. In some implementations, asession server or other server can synchronize game states on the memberdevices during the game by continually receiving game states from themember devices and sending synchronization updates to the memberdevices. Some implementations can provide peer-to-peer synchronizationbetween the member devices.

The embedded interface 970 includes features similar to embeddedinterface 910 of FIG. 9A, including a display area 972 to display outputof the game and which can be receptive to user input. A full screencontrol 974 allows user input to enlarge the embedded interface 970 tothe entire screen (or other display area) of the first device. A closecontrol 976 allows user input to close the embedded interface 970 andclose the embedded game application, e.g., so that it is no longerexecuting on the second device. A user identifier 978 can be displayedto indicate the second user of chat interface 940 as a player of thegame. In some implementations, a game score 980 can be displayed next tothe user identifier 978 to indicate the current score of the user. Inthis example, other user identifiers 982 and associated game scores 984are displayed to indicate the other player users participating in theembedded game session and their current scores in the shared game. Insome implementations, member users having an observer role or refereerole in the game can be displayed and visually differentiated in thedisplay from users having player roles.

In some implementations, the game provided in the embedded session canbe a real-time game in which player users may provide user input (e.g.,game actions) to the game at any time to change game states, and theembedded game application can provide output continuously in real-time,e.g., based on its own events and/or in response to the user input. Someimplementations can provide an embedded game application that isasynchronous or turn-based, e.g., where the game waits for input fromone player (or multiple players) to change the game state and/or output,and the game waits for the next input from the same or differentplayer(s), etc. Game output is displayed in the embedded interfaces ofobserver users, where input that the observer users are able to provideto the game is more restricted, e.g., does not affect game states.

Output from the game can be displayed in embedded interface 970 and/oras messages displayed in message display area 948 of chat interface 940.For example, messages from game objects can be displayed as chatmessages in message display area 948 as described above with respect toFIG. 6.

In some implementations, one or more embedded application indicators 986can be displayed in the chat interface to indicate which embeddedsessions are current active, similarly as described above.

FIGS. 10A to 10D are graphic representations of additional example userinterfaces displayed by user devices. In these examples, a messagingapplication is used for a chat conversation between users and anembedded application is used to provide a shared content document in theform of a shared list of items.

In FIG. 10A, an example of a chat interface 1000 of a messagingapplication is displayed on a first user device operated by a first user(e.g., “Emily D.”). In this example, a chat conversation “HanginOut” hasbeen initiated that includes participation of the first user and firstdevice similarly as described for FIGS. 8A and 9A. Chat messages fromthe first user can be input in an input field 1002 of chat interface1000 and the chat messages can be displayed in a message display area1004 of chat interface 1000.

In this example, several chat users have input messages in the chatconversation, as shown by messages 1006 input from three chat usersdifferent than the first user and displayed in the display area 1004.Chat messages 1008 have been input by the first user and displayed inthe chat interface in display area 1004. In this example, chat messagesfrom other users are identified by a graphical user identifier and chatmessages input by the first user are displayed right-justified on thedisplay screen.

An embedded session notification 1020 can be displayed in chat interface1000. Notification 1020 indicates that an embedded session is active,similarly to the notifications 858 and 958 described above for FIGS. 8and 9. In this example, notification 1020 is displayed after the user“Pamela” has initiated the embedded session by selecting an embeddedlist application to execute and selecting to share a list provided bythe embedded list application. Notification 1020 can be displayed inchat interface 1000 after the first device receives information from asession server or a chat device that the embedded session has beeninitiated and is active. Notification 1020 can be displayed in displayarea 1004 or other areas of chat interface 1000, or outside the chatinterface 1000 various implementations.

In this example, notification 1020 includes a designation 1024 (e.g.,icon or symbol) identifying the embedded list application used in theembedded session. Notification 1020 also includes the amount 1026 ofuser-response items currently in the list provided in the embeddedsession. Notification 1020 also includes list 1028 of the chat users whohave joined (e.g., are currently member users of) the embedded session.Notification 1020 also includes a join control 1030 allowing the firstuser to join the embedded session if selected, and a close control 1032causing the notification 1020 to be removed from the chat interface 1000if selected.

In some implementations, such as the example of FIG. 10A, a notification1022 can be displayed in the chat interface, e.g., in display area 1004,to indicate that a user has initiated an embedded session. Notification1022 can include a description of data provided in the embedded sessionthat was contributed or selected by member users, such as the number ofitems in a list in this example.

In FIG. 10B, chat interface 1000 of FIG. 10A is shown with an exampleupdate after the first user has selected to join the embedded sessionindicated in the notification 1020 of FIG. 10A. For example, the firstuser may have selected the join control 1030 of FIG. 10A. In FIG. 10B,an embedded interface 1040 has been displayed in the chat interface 1000such that a portion of the message display area 1004 (and one or morechat messages) remain displayed. For example, an embedded interface 1040can be provided by an embedded application that has been downloaded (insome cases) and executed by the first device in response to the firstuser joining the embedded session, similarly as described above. Inother implementations, the embedded interface 1040 is displayed based ondata received over the network, e.g., from an embedded applicationexecuting on a session server or other device. The embedded applicationis the same list application initiated by the user Pamela to create theembedded session indicated in notification 1020 of FIG. 10A.

In this example, embedded interface 1040 includes a name 1042 of ashared list, here based by default on the chat conversation name.Embedded interface 1040 displays items 1044 in a list, where an item1044 can be selected by member user input to indicate the item has beencompleted or is no longer relevant. An add control 1046 allows userinput to add a new item to the list and input text to name the new item.Completed items 1048 can be displayed with a visual indication that theyhave been selected by user input to be considered completed or achieved.A close control 1050 can also be provided. Other features such as anindication or list of member users who have contributed particular itemsto the list can be displayed in various implementations.

The list of items displayed in embedded interface 1040 are synchronizedwith the embedded interfaces of all the member devices such that eachmember device displays the same items and statuses of items in the list.In some implementations, one or more member users can be assigned anobserver status, e.g., by the member user that initiated the embeddedsession, where observer users cannot modify the list.

In FIG. 10C, chat interface 1000 of FIG. 10B is shown with an exampleupdate after the first user has selected to input a new message in thechat conversation of the chat interface. For example, the first user mayhave selected input field 1002 of chat interface 1000. In someimplementations, this can cause a displayed keyboard 1060 to bedisplayed in or adjacent to the chat interface 1000, which can be usedto input a new message. Some implementations can provide messagesuggestions 1062 as selectable elements responsive or related to one ormore chat messages, e.g., the last chat message 1064. Similarly as inFIG. 8D, some implementations can resize the embedded interface 1040 asshown in the example of FIG. 10C (e.g., shrink the size of the embeddedinterface) to allow display space for both the keyboard 1060 and chatmessages of the chat conversation in display area 1004 of the chatinterface 1000, such that keyboard 1060, embedded interface 1040, and aportion of display area 1004 are simultaneously displayed.

In FIG. 10D, chat interface 1000 of FIG. 10B is shown with an exampleupdate after the first user has selected to provide input to theembedded interface and to the embedded application. For example, thefirst user may have selected the add control 1046 of embedded interface1040 of FIG. 10B, e.g. using touchscreen input or input from anotherpointing input device, or may have selected a different option in theembedded interface that can accept text input from a keyboard. In othercases, the user may have selected a control in the embedded interface.In some implementations, this user input to the embedded interface cancause a displayed keyboard 1070 to be displayed in or adjacent to thechat interface 1000, where keyboard 1070 can be used to input text(including characters, emoji, symbols, etc.). For example, the firstuser can use the keyboard 1070 to input a text name or phrase for theadded item in the list.

Some implementations can provide one or more suggestions 1072 assuggested input for the embedded interface, e.g., based on an interfaceelement selected by the user input in the embedded interface and/orbased on an event of the embedded application. In this example,suggestions 1072 were determined based on the selection of the addcontrol 1046. For example, the embedded application (and/or themessaging application or suggestion server, after being sent the listitems) can examine the existing list items to determine suggested newlist items that are related to the existing items. For example, storedknowledge base or databases (e.g., hierarchical graph of relatedconcepts) can be examined to find words that are related to words in thelist.

In some implementations, as shown in FIG. 10D, while keyboard 1070 isdisplayed to allow input to the embedded interface 1040, the embeddedinterface 1040 can be maintained in its normal size as shown (or can bedisplayed in a larger size than the small-sized embedded interface 1040of FIG. 10C). The display area 1004 that displays chat messages can beremoved from the chat interface 1000 while keyboard 1070 is displayed toenable input to the embedded interface 1040, as shown.

Some implementations can display a keyboard similar to keyboard 1070 forinput to the embedded interface, and/or can display suggestions to beinput to the embedded interface similar to suggestions 1072, for othertypes of embedded applications, e.g., media players, games, documentprocessing applications, etc. as described herein for otherimplementations.

Examples of Bot Implementations

A bot is an automated service, implemented on one or more computers,that users interact with primarily through text, e.g., via messagingapplication 103 a/103 b. A bot may be implemented by a bot provider suchthat the bot can interact with users of various messaging applications.In some implementations, a provider of messaging application 103 a/103 bmay also provide one or more bots. In some implementations, botsprovided by the provider of messaging application 103 a/103 b may beconfigured such that the bots can be included in other messagingapplications, e.g., provided by other providers. In someimplementations, one or more bots can be provided by, generated by,and/or included in an embedded application.

A bot may provide several advantages over other modes. For example, abot may permit a user to try a new service (e.g., a taxi bookingservice, a restaurant reservation service, etc.) without having toinstall an application on a client device, or accessing a website.Further, a user may interact with a bot via text, which requires minimalor no learning compared with learning to use a website, softwareapplication, a telephone call to, e.g., an interactive voice response(IVR) service, or other manners of interacting with a service.Incorporating a bot within a messaging service or application may alsopermit users to collaborate with other users to accomplish various taskssuch as travel planning, shopping, scheduling events, obtaininginformation, etc. within the messaging service, and eliminate cumbersomeoperations such as switching between various applications (e.g., a taxibooking application, a restaurant reservation application, a calendarapplication, etc.) or websites to accomplish the tasks.

A bot may be implemented as a computer program or application (e.g., asoftware application) that is configured to interact with one or moreusers (e.g., any of the users 125 a-n) via messaging application 103a/103 b to provide information or to perform specific actions within themessaging application 103. As one example, an information retrieval botmay search for information on the Internet and present the most relevantsearch result within the messaging app. As another example, a travel botmay have the ability to make travel arrangements via messagingapplication 103, e.g., by enabling purchase of travel and hotel ticketswithin the messaging app, making hotel reservations within the messagingapp, making rental car reservations within the messaging app, and thelike. As another example, a taxi bot may have the ability to call ataxi, e.g., to the user's location (obtained by the taxi bot from clientdevice 115, when a user 125 permits access to location information)without having to invoke or call a separate taxi reservation app. Asanother example, a coach/tutor bot may tutor a user to instruct the userin some subject matter within a messaging app, e.g., by asking questionsthat are likely to appear on an examination and providing feedback onwhether the user's responses were correct or incorrect. As anotherexample, a game bot may play a game on the opposite side or the sameside as a user within a messaging app. As another example, a commercialbot may provide services from a specific merchant, e.g., by retrievingproduct information from the merchant's catalog and enabling purchasethrough a messaging app. As another example, an interface bot mayinterface a remote device or vehicle so that a user of a messaging appcan chat with, retrieve information from, and/or provide instructions tothe remote device or vehicle.

A bot's capabilities may include understanding a user's intent andexecuting on it. The user's intent may be understood by analyzing andunderstanding the user's conversation and its context. A bot may alsounderstand the changing context of a conversation or the changingsentiments and/or intentions of the users based on a conversationevolving over time. For example, if user A suggests meeting for coffeebut if user B states that he does not like coffee, then a bot may assigna negative sentiment score for coffee to user B and may not suggest acoffee shop for the meeting.

Implementing bots that can communicate with users of messagingapplication 103 a/103 b may provide many advantages. Conventionally, auser may utilize a software application or a website to performactivities such as paying bills, ordering food, booking tickets, etc. Aproblem with such implementations is that a user is required to installor use multiple software applications, and websites, in order to performthe multiple activities. For example, a user may have to installdifferent software applications to pay a utility bill (e.g., from theutility company), to buy movie tickets (e.g., a ticket reservationapplication from a ticketing service provider), to make restaurantreservations (e.g., from respective restaurants), or may need to visit arespective website for each activity. Another problem with suchimplementations is that the user may need to learn a complex userinterface, e.g., a user interface implemented using multiple userinterface elements, such as windows, buttons, checkboxes, dialog boxes,etc.

Consequently, an advantage of one or more described implementations isthat a single application enables a user to perform activities thatinvolve interaction with any number of parties, without being requiredto access a separate website or install and run software applications,which has a technical effect of reducing consumption of memory, storage,and processing resources on a client device. An advantage of thedescribed implementations is that the conversational interface makes iteasier and faster for the user to complete such activities, e.g.,without having to learn a complex user interface, which has a technicaleffect of reducing consumption of computational resources. Anotheradvantage of the described implementations is that implementing bots mayenable various participating entities to provide user interaction at alower cost, which has a technical effect of reducing the need forcomputational resources that are deployed to enable user interaction,such as a toll-free number implemented using one or more of acommunications server, a website that is hosted on one or more webservers, a customer support email hosted on an email server, etc.Another technical effect of described features is a reduction in theproblem of consumption of system processing and transmission resourcesused for completing user tasks across communication networks.

While certain examples herein describe interaction between a bot and oneor more users, various types of interactions, such as one-to-oneinteraction between a bot and a user 125, one-to-many interactionsbetween a bot and two or more users (e.g., in a group messagingconversation), many-to-one interactions between multiple bots and auser, and many-to-many interactions between multiple bots and multipleusers are be possible. Further, in some implementations, a bot may alsobe configured to interact with another bot (e.g., bots 107 a/107 b, 109a/109 b, 111, 113, etc.) via messaging application 103, via directcommunication between bots, or a combination. For example, a restaurantreservation bot may interact with a bot for a particular restaurant inorder to reserve a table.

In certain embodiments, a bot may use a conversational interface, suchas a chat interface, to use natural language to interactconversationally with a user. In certain embodiments, a bot may use atemplate-based format to create sentences with which to interact with auser, e.g., in response to a request for a restaurant address, using atemplate such as “the location of restaurant R is L.” In certain cases,a user may be enabled to select a bot interaction format, e.g., whetherthe bot is to use natural language to interact with the user, whetherthe bot is to use template-based interactions, etc.

In cases in which a bot interacts conversationally using naturallanguage, the content and/or style of the bot's interactions maydynamically vary based on one or more of: the content of theconversation determined using natural language processing, theidentities of the users in the conversations, and one or moreconversational contexts (e.g., historical information on the user'sinteractions, connections between the users in the conversation based ona social graph), external conditions (e.g., weather, traffic), theuser's schedules, related context associated with the users, and thelike. In these cases, the content and style of the bot's interactions isvaried based on only such factors for which users participating in theconversation have provided consent.

As one example, if the users of a conversation are determined to beusing formal language (e.g., no or minimal slang terms or emojis), thena bot may also interact within that conversation using formal language,and vice versa. As another example, if a user in a conversation isdetermined (based on the present and/or past conversations) to be aheavy user of emojis, then a bot may also interact with that user usingone or more emojis. As another example, if it is determined that twousers in a conversation are in remotely connected in a social graph(e.g., having two or more intermediate nodes between them denoting,e.g., that they are friends of friends of friends), then a bot may usemore formal language in that conversation. In the cases where usersparticipating in a conversation have not provided consent for the bot toutilize factors such as the users' social graph, schedules, location, orother context associated with the users, the content and style ofinteraction of the bot may be a default style, e.g., a neutral style,that doesn't require utilization of such factors.

Further, in some implementations, one or more bots may includefunctionality to engage in a back-and-forth conversation with a user.For example, if the user requests information about movies, e.g., byentering “@moviebot Can you recommend a movie?”, the bot “moviebot” mayrespond with “Are you in the mood for a comedy?” The user may thenrespond, e.g., “nope” to which the bot may respond with “OK. The sci-fimovie entitled Space and Stars has got great reviews. Should I book youa ticket?” The user may then indicate “Yeah, I can go after 6 pm. Pleasecheck if Steve can join”. Upon user's consent to the bot accessinginformation about their contacts and upon the friend Steve's consent toreceiving messages from the bot, the bot may send a message to user'sfriend Steve and perform further actions to book movie tickets at asuitable time.

In certain embodiments, a user participating in a chat conversation maybe enabled to invoke a specific bot or a bot performing a specific task,e.g., by typing a bot name or bot handle (e.g., taxi, @taxibot, @movies,etc.), by using a voice command (e.g., “invoke bankbot”, etc.), byactivation of a user interface element (e.g., a button or other elementlabeled with the bot name or handle), etc. Once a bot is invoked, a user125 may send a message to the bot via messaging application 103 a/103 bin a manner similar to sending messages to other users 125. For example,to order a taxi, a user may type “@taxibot get me a cab”; to make hotelreservations, a user may type “@hotelbot book a table for 4 at a Chineserestaurant near me.”

In certain embodiments, a bot may automatically suggest information oractions within a chat conversation without being specifically invoked.That is, the users may not need to specifically invoke the bot. In theseembodiments, the bot may depend on analysis and understanding of thechat conversation on a continual basis or at discrete points of time.The analysis of the chat conversation may be used to understand specificuser needs and to identify when assistance should be suggested by a bot.As one example, a bot may search for some information and suggest theanswer if it is determined that a user needs information (e.g., based onthe user asking a question to another user, based on multiple usersindicating they don't have some information). As another example, if itis determined that multiple users have expressed interest in eatingChinese food, a bot may automatically suggest a set of Chineserestaurants in proximity to the users, including optional informationsuch as locations, ratings and links to the websites of the restaurants.

In certain embodiments, rather than automatically invoking a bot orwaiting for a user to explicitly invoke a bot, an automatic suggestionmay be made to one or more users in a messaging conversation to invokeone or more bots. In these embodiments, the chat conversation may beanalyzed on a continual basis or at discrete points of time, and theanalysis of the conversation may be used to understand specific userneeds and to identify when a bot should be suggested within theconversation.

In the embodiments in which a bot may automatically suggest informationor actions within a chat conversation without being specificallyinvoked, such functionality is disabled, e.g., if one or more usersparticipating in the chat conversation do not provide consent to a botperforming analysis of the user's conversation. Further, suchfunctionality may also be disabled temporarily based on user input. Forexample, when the users indicate that a chat conversation is private,analysis of conversational context is suspended until users provideinput for the bot to be activated. Further, indications that analysisfunctionality is disabled may be provided to participants in the chatconversation, e.g., with a user interface element.

In various implementations, a bot may be implemented in a variety ofconfigurations. For example, as shown in FIG. 1, bot 105 is implementedon client device 115 a. In this example, the bot may be a module in asoftware application that is local to client device 115 a. For example,if a user has installed a taxi hailing application on client device 115a, bot functionality may be incorporated as a module in the taxi hailingapplication. In this example, a user may invoke a taxi bot, e.g., bysending a message “@taxibot get me a cab.” Messaging application 103 bmay automatically cause the bot module in the taxi hailing applicationbe launched. In this manner, a bot may be implemented locally on aclient device such that the user can engage in conversation with the botvia messaging application 103.

In another example shown in FIG. 1, bot 107 a is shown implemented onclient device 115 a and bot 107 b is shown as implemented on messagingserver 101. In this example, the bot may be implemented, e.g., as aclient-server computer program, with portions of the bot functionalityprovided by each of bot 107 a (server module) and bot 107 b (clientmodule). For example, if the bot is a scheduling bot with the handle@calendar, user 125 a may schedule a reminder, by typing “@calendarremind me to pick up laundry in the evening,” which may be handled bybot 107 b (client module). Continuing with this example, if user 125 atells the bot “check if Jim is free to meet at 4,” bot 107 a (servermodule) may contact user Jim (or Jim's scheduling bot) to exchangemessages, and provide a response to user 125 a.

In another example, bot 109 a (server module) is implemented on server135 and bot 109 b (client module) is implemented on client devices 115.In this example, the bot functionality is provided by modulesimplemented on client devices 115 and server 135, which is distinct frommessaging server 101. In some implementations, a bot may be implementedas a distributed application, e.g., with modules distributed acrossmultiple client devices and servers (e.g., client devices 115, server135, messaging server 101, etc.). In some implementations, a bot may beimplemented as a server application, e.g., bot 111 that is implementedon messaging server 101 and bot 113 that is implemented on server 135.

Different implementations such as client-only, server-only,client-server, distributed, etc. may provide different advantages. Forexample, client-only implementations permit bot functionality to beprovided locally, e.g., without network access, which may beadvantageous in certain contexts, e.g., when a user is outside ofnetwork coverage area or in any area with low or limited networkbandwidth. Implementations that include one or more servers, such asserver-only, client-server, or distributed configurations may permitcertain functionality, e.g., financial transactions, ticketreservations, etc. that may not be possible to provide locally on aclient device.

While FIG. 1 shows bots as distinct from messaging application 103, insome implementations, one or more bots may be implemented as part ofmessaging application 103. In the implementations in which bots areimplemented as part of messaging application 103, user permission isobtained before implementing bots. For example, where bots areimplemented as part of messaging application 103 a/103 b, messagingapplication 103 a/103 b may provide bots that can perform certainactivities, e.g., a translation bot that translates incoming andoutgoing messages, a scheduling bot that schedules events on a user'scalendar, etc. In this example, translation bot is activated only uponuser's specific permission. If the user does not provide consent, botswithin messaging application 103 a/103 b are not implemented (e.g.,disabled, removed, etc.). If the user provides consent, a bot ormessaging application 103 a/103 b may make limited use of messagesexchanged between users via messaging application 103 a/103 b to providespecific functionality, e.g., translation, scheduling, etc.

In some implementations, third parties distinct from a provider ofmessaging application 103 a/103 b and users 125, may provide bots thatcan communicate with users 125 via messaging application 103 a/103 b forspecific purposes. For example, a taxi service provider may provide ataxi bot, a ticketing service may provide a bot that can book eventtickets, a bank bot may provide capability to conduct financialtransactions, etc.

In implementing bots via messaging application 103, bots are permittedto communicate with users only upon specific user authorization. Forexample, if a user invokes a bot, the bot can reply, e.g., based on theuser's action of invoking the bot. In another example, a user mayindicate particular bots or types of bots that may contact the user. Forexample, a user may permit travel bots to communicate with her, but notprovide authorization for shopping bots. In this example, messagingapplication 103 a/103 b may permit travel bots to exchange messages withthe user, but filter or deny messages from shopping bots.

Further, in order to provide some functionality (e.g., ordering a taxi,making a flight reservation, contacting a friend, etc.), bots mayrequest that the user permit the bot to access user data, such aslocation, payment information, contact list, etc. In such instances, auser is presented with options to permit or deny access to the bot. Ifthe user denies access, the bot may respond via a message, e.g., “Sorry,I am not able to book a taxi for you.” Further, the user may provideaccess to information on a limited basis, e.g., the user may permit thetaxi bot to access a current location only upon specific invocation ofthe bot, but not otherwise. In different implementations, the user cancontrol the type, quantity, and granularity of information that a botcan access, and is provided with the ability (e.g., via a userinterface) to change such permissions at any time. In someimplementations, user data may be processed, e.g., to remove personallyidentifiable information, to limit information to specific dataelements, etc. before a bot can access such data. Further, users cancontrol usage of user data by messaging application 103 a/103 b and oneor more bots. For example, a user can specify that a bot that offerscapability to make financial transactions require user authorizationbefore a transaction is completed, e.g., the bot may send a message“Tickets for the movie Space and Starts are $12 each. Shall I go aheadand book?” or “The best price for this shirt is $125, includingshipping. Shall I charge your credit card ending 1234?” etc.

In some implementations, one or more suggested response items generatedby systems described above can be messages used to invoke or command abot, e.g., request a bot for information. For example, the system candetermine whether a received image includes content that would beassisted by information and/or one or more functions provided by a bot.In some examples, the first user in a conversation may send a textmessage to the second user, saying, “Guess where?” The first user thensends an image to the second user's device. The system can determinethat a phrase including the word “guess” indicates that a suggestedresponse can be a request to find out the information related to theimage content. (Other words can also indicate such a request, such as“where,” “what,” etc.) In response, the system can generate a suggestedresponse that is a request or command to an appropriate bot that canprovide the relevant information. For example, a suggested response canbe a request to a mapping bot to provide the name of the locationdepicted in the image (e.g., where the bot can determine suchinformation using web searches, maps and atlases, geographic locationmetadata of the received image, etc.). In some implementations, thetraining message data can be used (if user consent has been obtained) todetermine appropriate types of bots for particular types of imagecontent that has been detected in the image (e.g., using one or moreimage detection or recognition techniques, if user consent has beenobtained), and/or rules-based grammars can determine which types of botsto invoke in a suggested response based on the types of image contentand/or concepts detected in the image content.

In some implementations, if the bot-related suggested item is displayedfor the user as a possible response and the user selects thatsuggestion, the bot can be added to the chat conversation and messaginginterface, e.g., represented with a bot name. The bot can determine andoutput the requested information in the conversation, e.g., as messagesto both the first and second users in a chat interface.

In another example, the first user inputs an image depicting text thatis in a language foreign to the second user to a chat conversation orembedded application. The system can determine that an appropriatesuggested item is a request to a language bot to translate the text inthe image and to output the translated text in the chat interface orembedded interface.

In another example, the first user inputs an image depicting a food itemto a chat conversation. The system can determine that an appropriatesuggested response is a request to a bot to check one or more accessibledata sources (e.g., on the Internet) to determine the ingredients and/orcalories typically or specifically included in the food item, and tooutput that information in the message conversation interface.

Implementations described herein generally relate to messagingapplications. Certain implementations may automatically (e.g., withoutuser intervention) analyze image content of one or more chatconversations and/or user information to automatically provide suggesteditems to a user within a messaging application. In certain examples, theautomatic suggested items may be selected by a user to respond in theembedded application or in the messaging application, and/or may beautomatically provided as one or more appropriate responses on behalf ofa user. In certain other examples, the suggestions may automaticallyincorporate particular non-messaging functionality into the messagingapplication.

Suggested items may be provided based on any type of media content thatis received in a chat conversation. For example, such media content mayinclude stickers (e.g., in a chat application), animated images (e.g.,cinemagraphs, GIF images, etc.), and videos. Further, various types ofitems may be suggested. For example, suggested messages may include oneor more of an image, a sticker, an animated image (e.g., cinemagraph,GIF image, etc.) and a video. To provide these suggestions, a comparisoncan be made of identified concepts in a received item (e.g., text,image, video, sticker, animated image, etc.) with concepts in differenttypes of responses, and select a suitable response. In differentimplementations where users provide consent, the type of suggested itemmay be selected or prioritized based on context, e.g., a sticker may beprovided as a suggested item for a particular action in a game, a secondvideo may be provided as a suggested item for a playing video, etc.

Certain implementations enable messaging with human users and/or chatbots. In certain implementations, automatic suggested items may becustomized based on whether a chat bot is participating in the chatconversation. In some examples, a first set of automatic suggested itemsmay be provided if a chat bot is absent in a messaging conversation,while a second set of automatic suggested items may be provided if achat bot is present in the chat conversation, where the first and secondsets of suggested items are at least partially different. For example,these implementations may employ conversational rules followed by thechat bot, and suggest items to a user based on the rules. This canmitigate challenges that users may have in communicating with chat botsin a language and in a format that is easily understood by the chatbots.

Some implementations can include determining one or more trendingresponses (e.g., messages including popular message content sent by manydifferent users) based on other messages in at least one of a region,market, and country related to a location of a user. One or moredetermined suggested items may include one or more trending responses.In some implementations, a user context, e.g., a geographic location,holiday or an event, etc., can be used to generate and determine forpresentation one or more of the suggested items.

In some implementations, determining one or more suggested responseitems may be based on using machine learning to develop a personalizedmodel for a user. Determining suggested items may be based onpreferences of the user and/or prior actions of the user incommunications (if user consent for use of such actions and data hasbeen obtained). For example, user preferences may include a whitelistindicating particular words which can be included and/or a blacklistindicating particular words which cannot be included in messagesuggestions. If user consent has been obtained, suggested items can begenerated or modified based on one or more of punctuation use, emojiuse, or other content provided by the user on previous occasions.

Machine learning models used to provide suggested items may beimplemented by a client device 115 and/or a server, e.g., messagingserver 101 and/or a server 150-156. In some implementations, chatconversations may be encrypted such that only client devices ofparticipants in the chat conversation can access conversation content.In these implementations, models implemented by a respective clientdevice may be used to provide suggested response items and modelsimplemented by a server are not used. Models implemented by a clientdevice may also be used, e.g., when the user does not provide consentfor use of models implemented by a server. In some implementations,client implemented models may be based on or derived from serverimplemented models. In some implementations, server models may be usedand client models may not be used, e.g., when a client device lackscapability to implement client models. In some implementations, acombination of client and server models may be used.

While the examples described in this document utilize conceptsillustrated in English, suggestions may be provided in any language,e.g., a language, locale or other geographic configured for a clientdevice 115, a language selected based on a user preference, etc. In someimplementations, where users provide consent for analysis of context ofa chat conversation, a language that is used in various conversations(e.g., in recent messages) involving the user may be detected andmessage suggestions can be provided in that language.

Further Examples of Bots and Embedded Applications

In some implementations, bots as described above can be used by a userin conjunction with the use of an embedded application in one or morechat conversations implemented on a user device.

In some bot implementations, a user can participate in a chatconversation with a bot and without other human users participating inthe chat conversation. For example, an assistant bot can be provided bya local program executing on the user device, or provided by a server(e.g., server application program). In some examples, a new, bot chatconversation can be opened including the user and one or more bots, inresponse to the user inputting a bot command in a first chatconversation (e.g., command chat message), selecting a bot activationcontrol in the chat interface, etc. In the bot chat conversation, theuser can input information (e.g., questions, commands, statements) asmessages that can be processed by the bot, and the bot can send commandsor data to embedded applications based on those messages. For example, abot can initiate an appropriate embedded application associated with achat interface based on a command in the chat interface from a user tothe bot to join a particular embedded session, playback a media item,play a game, create a shared list, etc. In some implementations, botscan determine and present the suggested response items described herein,e.g., upon a command provided to the bot from user input in the chatinterface, and, e.g., simultaneously with execution of an embeddedapplication and embedded session to which the suggested response itemsare relevant. In some implementations, bots can receive informationrelated to events occurring in embedded applications and can generateand cause to be displayed interactive cards describing the events inembedded sessions, as described herein.

In some examples, in a chat conversation with a bot having media playerfunctionality, a user can input questions in the chat interface orconversation, and the bot can initiate a media player embeddedapplication that plays a particular media item in an embedded interfacedisplayed in association with the bot chat conversation or inassociation with a different chat conversation (e.g., a chatconversation including other human chat users). For example, if playedin association with a different chat conversation, the bot chatconversation can be hidden from the display and the different chatconversation can be displayed in the chat interface, with the embeddedinterface displayed in association with the chat interface.

In an example in which the embedded application can play a media item,e.g., as described in implementations herein, a media player bot can beinvoked in a chat conversation by a user. For example, the bot can beinvoked by inputting a command in the chat interface similarly to a chatmessage, and including command syntax (e.g., a symbol before thecommand), or by inputting a different type of selection (e.g., selectinga displayed interface element). The media player bot can support queriesfrom the user related to media items played or playable by the embeddedapplication.

In some implementations, a media player bot can be used to search forstored media items or other types of content items that have been savedin accessible storage by the user and/or by other chat users, and/orhave had links to the content items posted in the chat conversation. Insome examples, a query for the bot can be input to the chat interface asa chat message. For example, a search query can be provided as“@mediaplay cat videos” to cause the media player bot to search for catvideos in a collection of stored media items. Specific titles of mediaitems can also be queried. In some implementations, a conversationalsearch can be provided. For example, a search query can be input as“show me the most recent episode of Gameshow” or “play the most popularGameshow video” or “show me five videos you recommend for me to watch”or “send me a new cat video each day.” In some implementations, therecommended media items can be provided by a content server which mayhave tracked previous user viewings and preferences (with user consent)and ranked media items for the user.

Some implementations can provide one or more bots to receive user inputforming a search query used in searching for other data items or contentitems to be used in embedded applications. For example, such items caninclude items to be added to a shared list, a time in a particular timezone to be used in a travel itinerary, a name of a restaurant for areservation, etc. The bot can search for such items on databases,servers, or other resources accessible on the user device and over thenetwork. Items found by the bot in response to a search query can bepresented in the chat interface for selection by the user, or can beprovided automatically to the associated embedded application by the bot(and, in some implementations, the bot can initiate the embeddedapplication if the embedded application is not already executing). Itemsprovided to the embedded application can be displayed in the embeddedinterface, if appropriate.

In some implementations, as described above, playback of media items inan embedded session can be saved for later for a particular user toenable that user to play the media item at a later time, e.g., in a newembedded session. In some implementations, such saved media items caninclude recordings (e.g., captured video data, screen capture images,etc.) of games or other user and application activity/events thatoccurred in one or more embedded sessions with chat users, if consenthas been obtained from the chat users.

In some implementations, media items can be saved for the user in adedicated separate chat conversations. For example, a user can provide,in the chat conversation, user input to save a particular media item. Inresponse, a second chat conversation is identified that is associatedwith the user and a bot is associated with the media item. The mediaitem is inserted into the second chat conversation, and previous savedmedia items are also listed in the second chat conversation. Themessaging application can receive input from the user that is associatedwith the media item, e.g., to play a selected media item. In response,the first chat conversation is updated by playing the selected mediaitem using an embedded application.

In some additional examples, a save control can be provided in anotification indicating that a media player embedded session is active,or in association with a media item link displayed in the chatconversation. If, for example, a user receives a notification that amedia player embedded session is active (or sees a link to a media itemin the chat interface), the user can select the save control. Thisselection can cause a second chat conversation (e.g., media selectionchat conversation) to be displayed in which only the user and the botare participating. A link to the media item in the embedded session canbe displayed in the media selection chat conversation. Furthermore, anysaved media items from previous embedded sessions can be included in themedia selection chat conversation as previous messages. Thus, the usercan open the media selection chat conversation to select and play savedmedia items associated with the user. In some implementations, an optioncan be provided to automatically insert a user's media items into amedia selection chat conversation, e.g., to allow viewing and playing ofthe media items from a single collection.

In some implementations, the system (e.g., a bot) provides selections inthe chat interface for additional media items that are determined to besimilar to a media item that was shared in an embedded session. Forexample, the additional media items can have the same genre, wereauthored by or feature the same artists, etc.

In some implementations, a share option can be provided, which ifselected causes a media item being played in an embedded interface to beshared to a different chat conversation or share to a new chatconversation that is created for the selected sharing action. Forexample, to cause the share option to be displayed, a user can touch theembedded interface playing the media item for over a threshold amount oftime to cause the share option to be displayed, or can select aparticular displayed interface element.

In some implementations, the user can select a comment control to enableinputting a comment to the chat conversation associated with theembedded session playing the media item. In some implementations, a linkto play the media item is posted in the chat conversation, followed by auser comment input by the user. If the comment control is selected whileviewing a saved media item viewed in a different chat conversation(e.g., a media selection chat conversation as described above), theselected comment control can cause the originating chat conversation tobe opened and displayed, allowing the person to comment in theoriginating chat conversation where the media item was played in anembedded session.

In some implementations, suggested responses as described herein can beused with bots. For example, selection of a suggested response cantrigger a bot associated with the suggested response to perform one ormore actions in an embedded application, messaging application, or otherprogram or device. In some examples, a bot can perform an action onembedded application content without opening the embedded application.For example, the embedded application can allow a user to providecommands to the embedded application in the chat interface (e.g., byproviding a command to a bot), and allow users to interact with theembedded application visually via the embedded interface. In someexamples in which an embedded application has or communicates with aserver component (e.g., a game where game states are managed by aserver), commanding the bot via a chat message to perform actions in theembedded application and embedded interface also causes the actions tobe performed in the embedded interfaces displayed by other memberdevices. In another example, a shared list embedded application causeslist data to be stored on a server. The first user opens the shared listembedded application and adds items to the list or removes items fromthe list. Other users' devices can display suggested responses to additems to the list via bot commands to the embedded application using thechat interface. For example, the suggested responses can be in responseto chat messages such as “don't forget to buy drinks for the party”(e.g., a suggested response of “Add ‘Buy drinks’ to the ‘Tonight'sParty’ list”) or in response to chat messages such as “I just bought thesodas for tonight's party” (e.g., a suggested command of “Remove ‘BuySodas’ from the ‘Tonight's Party’ list”). In some implementations, theseexample suggested responses, when selected by the associated user, cancall the bot to send the command to the embedded application, and, e.g.,would not provide the command to the embedded interface. In someimplementations, an advantage of providing a bot interface (via chatinterface) instead of or in addition to the embedded interface is that avisual interface need not be displayed on a device, thus saving deviceprocessing, memory, and screen space resources, and enabling quick userinteraction with content data managed by the embedded application.

FIG. 11 is a diagrammatic illustration of an example sequence includinginitiation of an embedded application and a user joining an embeddedsession, according to some implementations. In this example, a firstuser 1102 (“User 1”) is operating a first user device that executesmessaging application 1104 which displays a first chat interface. Asecond user 1106 (“User 2”) is operating a second user device thatexecutes second messaging application 1108 which displays a second chatinterface, A chat conversation is provided over a network between themessaging applications 1104 and 1108 in which the users 1102 and 1106(and their devices) are participating, where the users are inputtingmessages in their respective chat interfaces to be displayed by theparticipating user devices.

In 1110, user 1102 selects to open an embedded application 1114 byproviding user input to messaging application 1104. At 1114, firstmessaging application 1104 initiates the selected embedded application1112. In some implementations, the first embedded application 1112 isdownloaded from a server, e.g., embedded application server 150 (notshown). At 1116, the initiated first embedded application 1112 causes anembedded interface to be displayed by the first user device, e.g., in,adjacent, or otherwise in association with the first chat interface, andwhich is viewed by first user 1102.

In addition to starting the embedded application, at 1118 the firstmessaging application sends information over the network indicating aninitiate event (or join event of the first user) based on the initiationof the first embedded application 1112. In this example, the event at1118 is sent to a message router 1120. Message router 1120 can be asession server 152 (e.g., included in a messaging server 101) or otherserver, in various examples. An embedded session can be created at themessage router in response to the initiate event some implementations,or can be created by the first user device, etc. Message router 1120sends the join event at 1118 to the second messaging application 1108operating on the second user device. At 1122, the second messagingapplication 1108 causes a notification to be displayed by the seconduser device to be viewed by the second user, e.g., in the second chatinterface, indicating that the first user 1102 has initiated an embeddedsession. In this example, the notification includes a displayed joinoption (e.g., interface element) for the second user to select to jointhe embedded session.

At 1124, the second user 1106 selects the displayed join option to jointhe embedded session, where this selection is provided to the secondmessaging application 1108. In response to the join selection, at 1126the second messaging application 1108 causes initiation of a secondembedded application 1128 on the second user device (e.g., downloaded insome implementations). At 1130, the second embedded application causesdisplay of a second embedded interface on the second user device. Inaddition to initiating the second embedded application, at 1132 thesecond messaging application 1108 sends information over the networkindicating a join event of the second user to the embedded session inresponse to the join selection at 1124. In this example, the join event1132 is sent to message router 1120.

The join event 1132 is sent by the message router 1120 over the networkto the first messaging application 1104 on the first user device. Inresponse, at 1122, the first messaging application 1104 sends a memberupdate to the first embedded application 1112 for the second userjoining the embedded session. For example, the member update can includedata indicating that the second user has joined, the chat identity ofthe second user, a selected user status of the second user, etc., asdescribed herein. In response to the member update, the first embeddedapplication 1112 updates the display of the first embedded interface at1136, as viewed by the first user 1102. For example, the chat identity(or other user identity) of the second user can be displayed in theembedded interface.

In various example implementations of systems, methods, andnon-transitory computer readable medium having stored softwareinstructions, an embedded application is provided in association with amessaging application. A first embedded application can be initiated inassociation with a first chat interface displayed by a first messagingapplication that executes at least in part on a first user device. Thefirst chat interface is configured to receive first user input from afirst user and display messages originating from one or more other userdevices participating in a chat conversation over a network. The one ormore other user devices are associated with one or more chat users, thechat users associated with respective chat identities. An indication isreceived over the network indicating that one or more particular userdevices of the other user devices have connected to an embedded sessionassociated with the first embedded application. In response to theindication, one or more chat identities are provided from the firstmessaging application to the first embedded application, which areassociated with one or more particular chat users of the particular userdevices. The particular chat users are designated as one or more memberusers of the embedded session, and the first embedded application isupdated based on data received from at least one of the particular userdevices of the embedded session.

In further examples, the first embedded application receives the firstuser input from the first user to an embedded interface displayed aspart of the first chat interface, and the first user input includesselection of an interface element in the embedded interface. The firstembedded application is updated in response to the first user input. Insome examples, each of the particular user devices of the embeddedsession execute a respective embedded application that provides arespective embedded interface associated with a respective chatinterface displayed on the respective particular user device, and thefirst embedded application is updated based on the data received from atleast one of the particular user devices of the embedded session. Thedata can include other user input received by at least one of therespective embedded interfaces from at least one of the one or moremember users of the embedded session. Output data can be obtained fromthe first embedded application to be displayed in the first chatinterface, and, in response to receiving the output data, a prompt isdisplayed by the first user device, the prompt including auser-selectable control to consent to display of the output data in thechat interface. Prior to providing the one or more chat identities tothe first embedded application, one or more of the chat identities canbe anonymized to create anonymized chat identities, such that theanonymized chat identities are provided to the first embeddedapplication.

In further examples, information is transmitted to the other userdevices participating in the chat conversation, which causes display ofan interface element by the other user devices, the interface elementreceptive to selective user input at each of the other user devices, andin response to receiving the selective user input at the interfaceelement on a particular user device, designating the particular userdevice as a member device of the embedded session. One or morecharacteristics of the one or more particular user devices can bedetermined and provided to the first embedded application, where thecharacteristics include a geographic location of at least one of theparticular user devices, a local time for at least one of the particularuser devices, and/or an available data bandwidth over the network for atleast one of the particular user devices, where the characteristics areused by the first embedded application to determine output informationto be displayed by the particular user devices, and/or cause amodification of transmission of input data to the first user device fromone or more other devices over the network. The indication can bereceived from a server that manages the embedded session, and updates tothe first embedded application can be received from the server, wherethe updates are based on the other user input from the particular chatusers, the other user input provided to the server.

In further examples, a notification is output, to be displayed inrespective chat interfaces of the one or more other user devices, wherethe notification indicates that the particular user devices are memberdevices of the embedded session. In some implementations, a notificationis output to the chat conversation in response to one or more particulartypes of events that occur in the embedded session, including eventsthat occur in the first embedded application and include initiation ofplayback of a media item, ceasing of the playback of the media item, achange in the playback of the media item based on the first user inputand/or the other user input, a game event occurring in a game of theembedded session, an update to the game based on the first user inputand/or the other user input, and/or an update to a shared contentdocument based on the first user input and/or the other user input. Insome implementations, a notification is output to the chat conversationin response to receiving server event information indicating that one ormore events have occurred on a server, and providing the server eventinformation to the first embedded application to display on the firstuser device.

In further examples, a suggestion event in the embedded session isdetermined based on receiving second user input received from the firstuser in the first chat interface, embedded event information from thefirst embedded application, and/or server event information from aserver coupled to the network, obtaining one or more suggested responseitems based on the suggestion event, and causing to be displayed the oneor more suggested response items by the first user device. For example,third user input indicative of a selected suggested response item can bereceived, causing output of a chat message associated with the selectedsuggested response item in the first chat interface displayed on thefirst user device and at the other user devices participating in thechat conversation. In another example, third user input selecting aselected suggested response item, and provide one or more commandsassociated with the selected suggested response item. In variousexamples, the commands can include at least one first command providedto the first embedded application, at least one second command providedto the first messaging application, and/or at least one third commandprovided to the first user device to cause display of output informationfrom a different application executing on the first user device. Theoutput information can include information received from a server devicein communication with the first user device. In further examples, thecommands can include a first command to add a first set of one or moreother users to the embedded session in response to determining that asecond content item is the same as a first content item being output inan embedded interface of the embedded application on the first userdevice, where the second content item is displayed on a first set of oneor more user devices not participating in the chat conversation. Thecommand can include a second command to add a second set of one or moreother users to the embedded session in response to determining that thesecond set of one or more other users have input user commentsassociated with a fourth content item that is the same as a thirdcontent item being output in the embedded interface on the first userdevice, where the fourth content item is displayed on a second set ofone or more user devices not participating in the chat conversation.

In further examples, content data can be received at the messagingapplication over a network from a server application executing at aserver device and provided to the embedded application to cause outputinformation to be displayed by the embedded application for the embeddedsession in an embedded interface displayed on the first user device andthe one or more particular user devices. Event information is receivedover the network indicating a suggestion event occurring at the serverapplication, where the suggestion event is based on input received bythe server application by one or more network users different than theone or more chat users. One or more suggested response items responsiveto the suggestion event are obtained, and the suggested response itemsare displayed in the first chat interface on the first user device.Suggested response items are selectable by user input to cause a messageto be displayed in the chat interface, and/or a command to be sent toone of the embedded application and the messaging application.

In further examples, prior to the one or more particular chat usersbeing designated as the one or more member users of the embeddedsession, selection input is received from the particular chat usersselecting one or more associated user roles for the embedded session.The associated user roles are selected from a plurality of predefineduser roles. In response to receiving the selection input, each of theone or more particular chat users is enabled to be assigned, in theembedded session, a respective associated user role selected by theparticular chat user. Each particular chat user is enabled to activateone or more functions of the embedded application associated with therespective associated user role selected by the particular chat user.Indications of the associated user roles and the particular chat usersare output by the first messaging application to the other user devicesto be displayed.

In further examples, a first user device joins a chat conversationprovided, at least in part, by a first messaging application thatexecutes at least in part on the first user device, and a first chatinterface is configured to receive first user input from the first userand display messages originating from one or more other chat users ofone or more other chat devices participating in the chat conversationover a network. Each chat user is associated with a chat identitydisplayed in the first chat interface. Second user input is receivedfrom the first user to the first chat interface and, in response to thesecond user input, a first embedded application is initiated inassociation with the first chat interface. The first embeddedapplication provides output information in an embedded interface that isdisplayed by the first user device such that least a portion of thefirst chat interface is visible. The chat identity associated with thefirst user is provided from the first messaging application to the firstembedded application, where the first user is designated as a memberuser of an embedded session associated with the first embeddedapplication, and the first embedded application is updated based onthird user input received from the first user to the embedded interface.In some examples, the other chat users include a bot executing on atleast one of the first user device and a server device connected to thefirst user device by a network. Based on fourth user input received fromthe first user in the first chat interface, the bot causes a display ofcontent data in the embedded interface.

In further examples, first user input is received from a first user to afirst embedded interface displayed in association with a first chatinterface by a first embedded application that executes in associationwith a first messaging application on a first user device. The firstuser input is received by the first embedded application, the first chatinterface is displayed by the first messaging application executing atleast in part on the first user device, and the first chat interface isconfigured to receive second user input from the first user and displaymessages received from one or more other user devices participating in achat conversation over a network. Each of the other user devices isassociated with a respective chat user, each chat user associated with achat identity displayed in the first chat interface. Other user input isreceived from one or more member users of one or more member devices ofthe one or more other user devices, where the member devices areincluded in an embedded session associated with the first embeddedapplication. One or more states of the embedded application are updatedbased on the first user input and based on the other user input, wherethe updating includes assigning a respective user status to each of themember users. Information indicating the respective user status of themember users is provided to the first messaging application to bedisplayed by the other user devices participating in the chatconversation.

FIG. 12 is a block diagram of an example device 1200 which may be usedto implement one or more features described herein. In one example,device 1200 may be used to implement a client device, e.g., any ofclient devices 115 shown in FIG. 1. Alternatively, device 1200 canimplement a server device, e.g., messaging server 101 and/or otherservers of FIG. 1. Device 1200 can be any suitable computer system,server, or other electronic or hardware device as described above.

One or more methods described herein can be run in a standalone programthat can be run on any type of computing device, a program run on a webbrowser, a mobile application (“app”) run on a mobile computing device(e.g., cell phone, smart phone, tablet computer, wearable device(wristwatch, armband, jewelry, headwear, virtual reality goggles orglasses, augmented reality goggles or glasses, etc.), laptop computer,etc.). In one example, a client/server architecture can be used, e.g., amobile computing device (as a client device) sends user input data to aserver device and receives from the server the final output data foroutput (e.g., for display). In another example, all computations can beperformed within the mobile app (and/or other apps) on the mobilecomputing device. In another example, computations can be split betweenthe mobile computing device and one or more server devices.

In some implementations, device 1200 includes a processor 1202, a memory1204, and input/output (I/O) interface 1206. Processor 1202 can be oneor more processors and/or processing circuits to execute program codeand control basic operations of the device 1200. A “processor” includesany suitable hardware and/or software system, mechanism or componentthat processes data, signals or other information. A processor mayinclude a system with a general-purpose central processing unit (CPU),multiple processing units, dedicated circuitry for achievingfunctionality, or other systems. Processing need not be limited to aparticular geographic location, or have temporal limitations. Forexample, a processor may perform its functions in “real-time,”“offline,” in a “batch mode,” etc. Portions of processing may beperformed at different times and at different locations, by different(or the same) processing systems. A computer may be any processor incommunication with a memory.

Memory 1204 is typically provided in device 1200 for access by theprocessor 1202, and may be any suitable processor-readable storagemedium, such as random access memory (RAM), read-only memory (ROM),Electrical Erasable Read-only Memory (EEPROM), Flash memory, etc.,suitable for storing instructions for execution by the processor, andlocated separate from processor 1202 and/or integrated therewith. Memory1204 can store software operating on the server device 1200 by theprocessor 1202, including an operating system 1208, messagingapplication 1210 and other applications (or engines) 1212 such as a datadisplay engine, web hosting engine, image display engine, notificationengine, social networking engine, etc. In some implementations, themessaging application 1210 can include instructions that enableprocessor 1202 to perform functions described herein, e.g., some or allof the methods of FIGS. 2-7. For example, messaging application 1210 cancommunicate with other applications and devices as described herein. Insome implementations, messaging application 1210 may include or beassociated with one or more embedded applications 1216, which canprovide features as described herein and can communicate with themessaging application 1210 to send and receive information from otherapplications 1212 and devices connected via a network. In someimplementations, messaging application 1210 can include one or moremodules, such as user interaction module 1218 managing a chat interfaceand/or other user interfaces, and/or these modules can be implemented inother applications or devices in communication with the device 1200. Theuser interaction module 1218 and/or one or more of the otherapplications 1212 can, for example, provide a displayed user interfaceresponsive to user input to display selectable options or controls, anddata based on selected options.

Other applications 1212 can include, e.g., image editing applications,media display applications, communication applications, web hostingengine or application, etc. One or more methods disclosed herein canoperate in several environments and platforms, e.g., as a stand-alonecomputer program that can run on any type of computing device, as a webapplication having web pages, as a mobile application (“app”) run on amobile computing device, etc.

In various implementations, the other applications 1212 can include amachine-learning application 1230 which can be used in variousimplementations described herein. For example, machine-learningapplication 1230 may utilize Bayesian classifiers, support vectormachines, neural networks, or other learning techniques. In someimplementations, machine-learning application 1230 may include a trainedmodel, an inference engine, and data. In some implementations, the datamay include training data, e.g., data used to generate the trainedmodel. For example, the training data may include any type of data suchas text, images, audio, video, etc. Training data may be obtained fromany source, e.g., a data repository specifically marked for training,data for which permission is provided for use as training data formachine-learning, etc. In implementations where one or more users permituse of their respective user data to train the trained model, trainingdata may include such user data. In implementations where users permituse of their respective user data, the data may include permitted datasuch as images (e.g., photos or other user-generated images),communications (e.g., e-mail; chat data such as text messages, voice,video, etc.), documents (e.g., spreadsheets, text documents,presentations, etc.)

In some implementations, the data may include collected data such as mapdata, image data (e.g., satellite imagery, overhead imagery, etc.), gamedata, etc. In some implementations, training data may include syntheticdata generated for the purpose of training, such as data that is notbased on user input or activity in the context that is being trained,e.g., data generated from simulated conversations, computer-generatedimages, etc. In some implementations, machine-learning application 1230excludes the data. For example, in these implementations, the trainedmodel may be generated, e.g., on a different device, and be provided aspart of machine-learning application 1230. In various implementations,the trained model may be provided as a data file that includes a modelstructure or form, and associated weights. The inference engine may readthe data file for the trained model and implement a neural network withnode connectivity, layers, and weights based on the model structure orform specified in the trained model.

The machine-learning application also includes a trained model. In someimplementations, the trained model may include one or more model formsor structures. For example, model forms or structures can include anytype of neural-network, such as a linear network, a deep neural networkthat implements a plurality of layers (e.g., “hidden layers” between aninput layer and an output layer, with each layer being a linearnetwork), a convolutional neural network (e.g., a network that splits orpartitions input data into multiple parts or tiles, processes each tileseparately using one or more neural-network layers, and aggregates theresults from the processing of each tile), a sequence-to-sequence neuralnetwork (e.g., a network that takes as input sequential data, such aswords in a sentence (e.g., in a chat message), frames in a video, etc.and produces as output a result sequence), etc. The model form orstructure may specify connectivity between various nodes andorganization of nodes into layers. For example, nodes of a first layer(e.g., input layer) may receive data as input data or application data.Such data can include, for example, one or more pixels per node, e.g.,when the trained model is used for image analysis. Subsequentintermediate layers may receive as input output of nodes of a previouslayer per the connectivity specified in the model form or structure.These layers may also be referred to as hidden layers. A final layer(e.g., output layer) produces an output of machine-learning application1230. For example, the output may be a set of labels for an image, arepresentation of the image that permits comparison of the image toother images (e.g., a feature vector for the image), an output sentencein response to an input sentence, one or more categories for the inputdata, etc. depending on the specific trained model. In someimplementations, model form or structure also specifies a number and/ortype of nodes in each layer.

Indifferent implementations, the trained model can include a pluralityof nodes, arranged into layers per the model structure or form. In someimplementations, the nodes may be computational nodes with no memory,e.g., configured to process one unit of input to produce one unit ofoutput. Computation performed by a node may include, for example,multiplying each of a plurality of node inputs by a weight, obtaining aweighted sum, and adjusting the weighted sum with a bias or interceptvalue to produce the node output. In some implementations, thecomputation performed by a node may also include applying astep/activation function to the adjusted weighted sum. In someimplementations, the step/activation function may be a nonlinearfunction. In various implementations, such computation may includeoperations such as matrix multiplication. In some implementations,computations by the plurality of nodes may be performed in parallel,e.g., using multiple processors cores of a multicore processor, usingindividual processing units of a GPU, or special-purpose neuralcircuitry. In some implementations, nodes may include memory, e.g., maybe able to store and use one or more earlier inputs in processing asubsequent input. For example, nodes with memory may include longshort-term memory (LSTM) nodes. LSTM nodes may use the memory tomaintain “state” that permits the node to act like a finite statemachine (FSM). Models with such nodes may be useful in processingsequential data, e.g., words in a sentence or a paragraph, frames in avideo, speech or other audio, etc.

In some implementations, the trained model may include embeddings orweights for individual nodes. For example, a model may be initiated as aplurality of nodes organized into layers as specified by the model formor structure. At initialization, a respective weight may be applied to aconnection between each pair of nodes that are connected per the modelform, e.g., nodes in successive layers of the neural network. Forexample, the respective weights may be randomly assigned, or initializedto default values. The model may then be trained, e.g., using the datadescribed above, to produce a result.

For example, training may include applying supervised learningtechniques. In supervised learning, the training data can include aplurality of inputs (e.g., a set of images) and a corresponding expectedoutput for each input (e.g., one or more labels for each image). Basedon a comparison of the output of the model with the expected output,values of the weights are automatically adjusted, e.g., in a manner thatincreases a probability that the model produces the expected output whenprovided similar input.

In some implementations, training may include applying unsupervisedlearning techniques. In unsupervised learning, only input data may beprovided and the model may be trained to differentiate data, e.g., tocluster input data into a plurality of groups, where each group includesinput data that are similar in some manner. For example, the model maybe trained to differentiate images such that the model distinguishesabstract images (e.g., synthetic images, human-drawn images, etc.) fromnatural images (e.g., photos).

In another example, a model trained using unsupervised learning maycluster words based on the use of the words in input sentences. In someimplementations, unsupervised learning may be used to produce knowledgerepresentations, e.g., that may be used by machine-learning application1230. In various implementations, a trained model includes a set ofweights, or embeddings, corresponding to the model structure. Inimplementations where the data is omitted, machine-learning application1230 may include the trained model that is based on prior training,e.g., by a developer of machine-learning application 1230, by athird-party, etc. In some implementations, the trained model may includea set of weights that are fixed, e.g., downloaded from a server thatprovides the weights.

Machine-learning application 1230 also may include an inference engine.The inference engine is configured to apply the trained model to data,such as application data, to provide an inference. In someimplementations, inference engine may include software code to beexecuted by processor 1202. In some implementations, the inferenceengine may specify circuit configuration (e.g., for a programmableprocessor, for a field programmable gate array (FPGA), etc.) enablingprocessor 1202 to apply the trained model. In some implementations, theinference engine may include software instructions, hardwareinstructions, or a combination. In some implementations, the inferenceengine may offer an application programming interface (API) that can beused by operating system 1208 and/or other applications 1212 to invokethe inference engine, e.g., to apply the trained model to applicationdata to generate an inference.

Machine-learning application 1230 may provide several technicaladvantages. For example, when the trained model is generated based onunsupervised learning, the trained model can be applied by inferenceengine to produce knowledge representations (e.g., numericrepresentations) from input data, e.g., application data. For example, amodel trained for image analysis may produce representations of imagesthat have a smaller data size (e.g., 1 KB) than input images (e.g., 10MB). In some implementations, such representations may be helpful toreduce processing cost (e.g., computational cost, memory usage, etc.) togenerate an output (e.g., a label, a classification, a sentencedescriptive of the image, etc.). In some implementations, suchrepresentations may be provided as input to a different machine-learningapplication that produces output from the output of the inferenceengine. In some implementations, knowledge representations generated bymachine-learning application 1230 may be provided to a different devicethat conducts further processing, e.g., over a network. In suchimplementations, providing the knowledge representations rather than theimages may provide a technical benefit, e.g., enable faster datatransmission with reduced cost. In another example, a model trained forclustering documents may produce document clusters from input documents.The document clusters may be suitable for further processing (e.g.,determining whether a document is related to a topic, determining aclassification category for the document, etc.) without the need toaccess the original document, and therefore, save computational cost.

In some implementations, machine-learning application 1230 may beimplemented in an offline manner. In these implementations, the trainedmodel may be generated in a first stage, and provided as part ofmachine-learning application 1230. In some implementations,machine-learning application 1230 may be implemented in an onlinemanner. For example, in such implementations, an application thatinvokes machine-learning application 1230 (e.g., operating system 1208,one or more of other applications 1212) may utilize an inferenceproduced by machine-learning application 1230, e.g., provide theinference to a user, and may generate system logs (e.g., if permitted bythe user, an action taken by the user based on the inference; or ifutilized as input for further processing, a result of the furtherprocessing). System logs may be produced periodically, e.g., hourly,monthly, quarterly, etc. and may be used, with user permission, toupdate the trained model, e.g., to update embeddings for the trainedmodel.

In some implementations, machine-learning application 1230 may beimplemented in a manner that can adapt to particular configuration ofdevice 1200 on which machine-learning application 1230 is executed. Forexample, machine-learning application 1230 may determine a computationalgraph that utilizes available computational resources, e.g., processor1202. For example, if machine-learning application 1230 is implementedas a distributed application on multiple devices, machine-learningapplication 1230 may determine computations to be carried out onindividual devices in a manner that optimizes computation. In anotherexample, machine-learning application 1230 may determine that processor1202 includes a GPU with a particular number of GPU cores (e.g., 1,000)and implement the inference engine accordingly (e.g., as 1,000individual processes or threads).

In some implementations, machine-learning application 1230 may implementan ensemble of trained models. For example, the trained model mayinclude a plurality of trained models that are each applicable to sameinput data. In these implementations, machine-learning application 1230may choose a particular trained model, e.g., based on availablecomputational resources, success rate with prior inferences, etc. Insome implementations, machine-learning application 1230 may execute theinference engine such that a plurality of trained models is applied. Inthese implementations, machine-learning application 1230 may combineoutputs from applying individual models, e.g., using a voting-techniquethat scores individual outputs from applying each trained model, or bychoosing one or more particular outputs. Further, in theseimplementations, machine-learning application may apply a time thresholdfor applying individual trained models (e.g., 0.5 ms) and utilize onlythose individual outputs that are available within the time threshold.Outputs that are not received within the time threshold may not beutilized, e.g., discarded. For example, such approaches may be suitablewhen there is a time limit specified while invoking machine-learningapplication 1230, e.g., by operating system 1208 or one or moreapplications 1212.

In different implementations, machine-learning application 1230 canproduce different types of outputs. For example, machine-learningapplication 1230 can provide representations or clusters (e.g., numericrepresentations of input data), labels (e.g., for input data thatincludes images, documents, etc.), phrases or sentences (e.g.,descriptive of an image or video, suitable for use as a response to aninput sentence, etc.), images (e.g., generated by machine-learningapplication 1230 in response to input), audio or video (e.g., inresponse an input video, machine-learning application 1230 may producean output video with a particular effect applied, e.g., rendered in acomic-book or particular artist's style, when the trained model istrained using training data from the comic book or particular artist,etc. In some implementations, machine-learning application 1230 mayproduce an output based on a format specified by an invokingapplication, e.g. operating system 1208 or one or more applications1212. In some implementations, an invoking application may be anothermachine-learning application. For example, such configurations may beused in generative adversarial networks, where an invokingmachine-learning application is trained using output frommachine-learning application 1230 and vice-versa.

Any of software in memory 1204 can alternatively be stored on any othersuitable storage location or computer-readable medium. In addition,memory 1204 (and/or other connected storage device(s)) can store one ormore messages, one or more taxonomies, electronic encyclopedia,dictionaries, thesauruses, message data, grammars, user preferences,and/or other instructions and data used in the features describedherein. Memory 1204 and any other type of storage (magnetic disk,optical disk, magnetic tape, or other tangible media) can be considered“storage” or “storage devices.”

I/O interface 1206 can provide functions to enable interfacing theserver device 1200 with other systems and devices. Interfaced devicescan be included as part of the device 1200 or can be separate andcommunicate with the device 1200. For example, network communicationdevices, storage devices (e.g., memory and/or database 106), andinput/output devices can communicate via I/O interface 1206. In someimplementations, the I/O interface can connect to interface devices suchas input devices (keyboard, pointing device, touchscreen, microphone,camera, scanner, sensors, etc.) and/or output devices (display device,speaker devices, printer, motor, etc.).

Some examples of interfaced devices that can connect to I/O interface1206 can include one or more display devices 1220 that can be used todisplay content, e.g., images, video, and/or a user interface of anoutput application as described herein. Display device 1220 can beconnected to device 1200 via local connections (e.g., display bus)and/or via networked connections and can be any suitable display device.Display device 1220 can include any suitable display device such as anLCD, LED, or plasma display screen, CRT, television, monitor,touchscreen, 3-D display screen, or other visual display device. Forexample, display device 1220 can be a flat display screen provided on amobile device, multiple display screens provided in a goggles device, ora monitor screen for a computer device.

The I/O interface 1206 can interface to other input and output devices.Some examples include one or more cameras which can capture images. Someimplementations can provide a microphone for capturing sound (e.g., as apart of captured images, voice commands, etc.), audio speaker devicesfor outputting sound, or other input and output devices.

For ease of illustration, FIG. 12 shows one block for each of processor1202, memory 1204, I/O interface 1206, and software blocks 1208, 1210,and 1212. These blocks may represent one or more processors orprocessing circuitries, operating systems, memories, I/O interfaces,applications, and/or software modules. In other implementations, device1200 may not have all of the components shown and/or may have otherelements including other types of elements instead of, or in additionto, those shown herein. While some components are described asperforming blocks and operations as described in some implementationsherein, any suitable component or combination of components ofenvironment 100, device 1200, similar systems, or any suitable processoror processors associated with such a system, may perform the blocks andoperations described.

Methods described herein can be implemented by computer programinstructions or code, which can be executed on a computer. For example,the code can be implemented by one or more digital processors (e.g.,microprocessors or other processing circuitry) and can be stored on acomputer program product including a non-transitory computer readablemedium (e.g., storage medium), such as a magnetic, optical,electromagnetic, or semiconductor storage medium, includingsemiconductor or solid state memory, magnetic tape, a removable computerdiskette, a random access memory (RAM), a read-only memory (ROM), flashmemory, a rigid magnetic disk, an optical disk, a solid-state memorydrive, etc. The program instructions can also be contained in, andprovided as, an electronic signal, for example in the form of softwareas a service (SaaS) delivered from a server (e.g., a distributed systemand/or a cloud computing system). Alternatively, one or more methods canbe implemented in hardware (logic gates, etc.), or in a combination ofhardware and software. Example hardware can be programmable processors(e.g. Field-Programmable Gate Array (FPGA), Complex Programmable LogicDevice), general purpose processors, graphics processors, ApplicationSpecific Integrated Circuits (ASICs), and the like. One or more methodscan be performed as part of or component of an application running onthe system, or as an application or software running in conjunction withother applications and operating system.

Although the description has been described with respect to particularimplementations, these particular implementations are merelyillustrative, and not restrictive. Concepts illustrated in the examplesmay be applied to other examples and implementations.

In situations in which certain implementations discussed herein maycollect or use personal information about users (e.g., user data,information about a user's social network, user's location and time,user's biometric information, user's activities and demographicinformation), users are provided with one or more opportunities tocontrol whether the personal information is collected, whether thepersonal information is stored, whether the personal information isused, and how the information is collected about the user, stored andused. That is, the systems and methods discussed herein collect, storeand/or use user personal information specifically upon receivingexplicit authorization from the relevant users to do so. In addition,certain data may be treated in one or more ways before it is stored orused so that personally identifiable information is removed. As oneexample, a user's identity may be treated so that no personallyidentifiable information can be determined. As another example, a user'sgeographic location may be generalized to a larger region so that theuser's particular location cannot be determined.

Note that the functional blocks, operations, features, methods, devices,and systems described in the present disclosure may be integrated ordivided into different combinations of systems, devices, and functionalblocks as would be known to those skilled in the art. Any suitableprogramming language and programming techniques may be used to implementthe routines of particular implementations. Different programmingtechniques may be employed such as procedural or object-oriented. Theroutines may execute on a single processing device or multipleprocessors. Although the steps, operations, or computations may bepresented in a specific order, the order may be changed in differentparticular implementations. In some implementations, multiple steps oroperations shown as sequential in this specification may be performed atthe same time.

What is claimed is:
 1. A computer-implemented method to provide anembedded application in association with a messaging application, thecomputer-implemented method comprising: causing a first embeddedapplication to be initiated on a first user device in association with afirst chat interface displayed by a first messaging application thatexecutes at least in part on the first user device, wherein the firstchat interface is configured to display messages from the first userdevice and messages from a second user device that communicates with thefirst user device via a chat conversation over a network; determiningthat the second user device is included in an embedded sessionassociated with the first embedded application; causing, via the firstmessaging application, the first embedded application to connect to theembedded session, wherein the first user device and the second userdevice are enabled to communicate with each other within the embeddedsession, and the embedded session is updated based on data received fromthe first user device and the second user device; causing output of afirst content item in a first embedded interface of the first embeddedapplication on the first user device; determining that a second contentitem is currently displayed on a third user device not communicating inthe chat conversation and that the second content item corresponds tothe first content item currently being output in the first embeddedinterface of the first embedded application on the first user device;and in response to determining that the second content item correspondsto the first content item, causing the third user device to be connectedto the embedded session.
 2. The computer-implemented method of claim 1,wherein determining that the second content item corresponds to thefirst content item includes determining that the second content item hasa same title as the first content item.
 3. The computer-implementedmethod of claim 1, wherein determining that the second content item iscurrently displayed on the third user device includes determining thatthe second content item is currently displayed on the third user deviceby one of: a third embedded application, a viewing application, or a webapplication executing on the third user device.
 4. Thecomputer-implemented method of claim 1 further comprising causing auser-selectable element to be displayed in the first chat interface inresponse to determining that the second content item corresponds to thefirst content item, wherein causing the third user device to beconnected to the embedded session is in response to user selection ofthe user-selectable element.
 5. The computer-implemented method of claim1, further comprising causing a user-selectable element to be displayedin the first chat interface in response to determining that the thirduser device has received user comments as user input, the user commentsassociated with the second content item, wherein selection of theuser-selectable element by a user causes the user comments to bedisplayed by the first user device.
 6. The computer-implemented methodof claim 1, wherein causing the third user device to be connected to theembedded session includes sending a command to the third user device toexecute a third embedded application on the third user device, the thirdembedded application synchronizing the second content item with thefirst content item in the embedded session.
 7. The computer-implementedmethod of claim 6, further comprising: determining a role in theembedded session for a third user of the third user device, whereindetermining the role is based on at least one of: a history of use ofthe third embedded application by the third user, or an available databandwidth over the network for the third user device; causing display ofthe role by the third user device; receiving selection input from thethird user selecting the role for the embedded session; in response toreceiving the selection input, causing the third user to be assigned, inthe embedded session, the role selected by the third user, wherein thethird user is enabled to activate one or more functions of the thirdembedded application associated with the role selected by the thirduser; and causing output of indications of the selected role of thethird user to the first user device and the second user device.
 8. Thecomputer-implemented method of claim 1, wherein the first embeddedapplication receives first user input at an embedded interface displayedas part of the first chat interface, and wherein the third user deviceexecutes a third embedded application that provides a third embeddedinterface associated with a third chat interface displayed on the thirduser device, and wherein the first embedded application is updated basedon data received from the third user device, wherein the data includesthird user input received by the third embedded interface from a thirduser of the third user device.
 9. The computer-implemented method ofclaim 1, further comprising outputting a notification to the chatconversation in response to one or more particular types of events thatoccur in the embedded session, wherein the one or more particular typesof events include events that occur in the first embedded applicationand include at least one of: a change in playback of the first contentitem in the first embedded application based on at least one of firstuser input, second user input, and third user input; or an update to agame based on at least one of first user game input, second user gameinput, and third user game input.
 10. The computer-implemented method ofclaim 1, further comprising, in response to the first user devicedisconnecting from the network, caching a state of the first embeddedapplication in storage, and in response to the first user devicereconnecting to the network after the disconnecting, synchronizing thefirst embedded application with the embedded session using the cachedstate of the first embedded application.
 11. The computer-implementedmethod of claim 1, further comprising, after the third user device isconnected to the embedded session: determining one or morecharacteristics of the third user device; and providing the one or morecharacteristics to the first embedded application, wherein the one ormore characteristics include at least one of: a geographic location ofthe third user device; or an available data bandwidth over the networkfor the third user device, wherein the one or more characteristics areused by the first embedded application to at least one of: determineoutput information to be displayed by the first user device, and cause amodification of transmission of input data received by the first userdevice from the third user device over the network.
 12. Thecomputer-implemented method of claim 1, further comprising: causingoutput of a notification to the chat conversation in response toreceiving server event information indicating that one or more eventshave occurred on a server; and providing the server event information tothe first embedded application for display on the first user device. 13.The computer-implemented method of claim 1, further comprising: causinga first user of the first user device to be assigned, in the embeddedsession, a user role, wherein the first user device is enabled toactivate one or more functions of the first embedded applicationassociated with the user role, wherein the user role is automaticallyselected based on one or more chat messages input by the first user tothe chat conversation; and outputting indications of the user role andthe first user by the first messaging application to the second userdevice and the third user device.
 14. The computer-implemented method ofclaim 1, further comprising: receiving information from the third userdevice that indicates a role of the third user in the embedded session;and enabling the third user device to activate one or more functionsassociated with the role for a third embedded application executing onthe third user device.
 15. A system comprising: a memory withinstructions stored thereon; and at least one processor configured toaccess the memory and configured to execute the instructions to performoperations comprising: causing a first embedded application to beinitiated on a first user device in association with a first chatinterface displayed by a first messaging application that executes atleast in part on the first user device, wherein the first chat interfaceis configured to display messages from the first user device andmessages from a second user device that is that communicates with thefirst user device via a chat conversation over a network; determiningthat the second user device is included in an embedded sessionassociated with the first embedded application; causing, via the firstmessaging application, the first embedded application to connect to theembedded session, wherein the first user device and the second userdevice are enabled to communicate with each other within the embeddedsession, and the embedded session is updated based on data received fromthe first user device and the second user device; causing output of afirst content item in a first embedded interface of the first embeddedapplication on the first user device; determining that a second contentitem is currently displayed on a third user device not communicating inthe chat conversation and that the second content item corresponds tothe first content item currently being output in the first embeddedinterface of the first embedded application on the first user device;and in response to determining that the second content item correspondsto the first content item, causing the third user device to be connectedto the embedded session.
 16. The system of claim 15, wherein theoperation of causing the third user device to be connected to theembedded session includes sending a command to the third user device toexecute a third embedded application on the third user device, the thirdembedded application synchronizing the second content item with thefirst content item in the embedded session.
 17. The system of claim 15,wherein the operations further comprise: determining a suggestion eventin the embedded session based on receiving at least one of: first userinput received from a first user in the first chat interface, embeddedevent information from the first embedded application, and server eventinformation from a server coupled to the network; obtaining one or moresuggested response items based on the suggestion event; causing to bedisplayed the one or more suggested response items by the first userdevice; receiving second user input indicative of a selected suggestedresponse item from the one or more suggested response items; and causingoutput of a chat message associated with the selected suggested responseitem in the first chat interface displayed on the first user device andin respective chat interfaces displayed on the second user device andthird user device.
 18. A non-transitory computer readable medium havingstored thereon software instructions that, when executed by a processor,cause the processor to perform operations including: causing a firstembedded application to be initiated on a first user device inassociation with a first chat interface displayed by a first messagingapplication that executes at least in part on the first user device,wherein the first chat interface is configured to display messages fromthe first user device and messages from a second user device thatcommunicates with the first user device via a chat conversation over anetwork; determining that the second user device is included in anembedded session associated with the first embedded application;causing, via the first messaging application, the first embeddedapplication to connect to the embedded session, wherein the first userdevice and the second user device are enabled to communicate with eachother within the embedded session, and the embedded session is updatedbased on data received from the first user device and the second userdevice; causing output of a first content item in a first embeddedinterface of the first embedded application on the first user device;determining that a second content item is currently displayed on a thirduser device not communicating in the chat conversation and that thesecond content item corresponds to the first content item currentlybeing output in the first embedded interface of the first embeddedapplication on the first user device; and in response to determiningthat the second content item corresponds to the first content item,causing the third user device to be connected to the embedded session.19. The non-transitory computer readable medium of claim 18, wherein theoperation of causing the third user device to be connected to theembedded session includes sending a command to the third user device toexecute a third embedded application on the third user device, the thirdembedded application synchronizing the second content item with thefirst content item in the embedded session.
 20. The non-transitorycomputer readable medium of claim 18, further comprising an operation ofoutputting a notification to the chat conversation in response to one ormore particular types of events that occur in the embedded session,wherein the one or more particular types of events include events thatoccur in the first embedded application include at least one of: achange in playback of the first content item in the first embeddedapplication based on at least one of first user input, second userinput, and third user input. an update to a game of the embedded sessionbased on at least one of the first user input, the second user input,and the third user input; or an update to a shared content documentbased on at least one of the first user input, the second user input,and the third user input.